0

I need to make some changes to the way the OSMnx package gets data from the Overpass API.

To do that, I've forked the repo and cloned that fork into a local directory.

I've made a simple change, adding a print functions to start.

I'm trying to figure out the steps for installing and importing the modified version of the package. I've looked at this question

I'm concerned about a namespace conflict, should I change the name of the folder or the name value in the setup.pyfile. I don't want to write over the working version of the package

What file should I point to when installing? setup.py, core.py, _init_.py?

I haven't found any tutorials on how to modify an existing package safely, just stuff on how to make a package from scratch.

Hugh_Kelley
  • 988
  • 1
  • 9
  • 23

1 Answers1

0

import will search the installed packages list first, then it will check the directory it was called from for files that match the package it's looking for.

So either using pip or conda remove the original version of the package being imported.

Then, be sure that the modified version of the package that you want to import is in a sibdirectory of your project directory, and run import package as xx and it should load the modified package files.

If it doesn't, it's likely that the package wasn't removed from the right environment.

Hugh_Kelley
  • 988
  • 1
  • 9
  • 23