I develop a package fhg_isi and currently have installed version 0.0.1.
What is the recommended way to switch between the local version 0.0.2 (being in development) and the installed version?
I am already able to load the local version by modifying the system path (and If I want to use the installed version, I can comment out the modification of the system path)
import sys
# If you want to use the local version of fhg_isi package,
# insert its absolute path to the python system path, for example:
local_fhg_isi_path = 'C:/python_env/workspace/fhg_isi/src'
sys.path.insert(1, local_fhg_isi_path) # out comment this line to use installed version
from fhg_isi.gis.geojson_factory import GeojsonFactory # This import stays the same for both cases
...
Also see: How can you import a local version of a python package?
However, PyCharm does not recognize the switch of the libraries. If I Ctrl-Click on GeojsonFactory
, I still navigate to the installed version instead of local version.
=> Is there a more comfortable way to switch between the packages, including IDE support, without modification of all the import statements?