I installed a Python module from GitHub. Here is an example of the commands I ran:
cd ~/modules/
git clone https://github.com/user/xyz
cd xyz
python setup.py develop
this installed the the module succesfully in the current folder. Then from some other folder, I did:
cd ~/test
python -c 'import inspect; import xyz; print(inspect.getfile(xyz))'
wich gave the following output:
/home/hakon/modules/xyz/xyz/__init__.py
Now, I decided I wanted to move the install folder. For example,
cd ~/modules/xyz
mv xyz xyz2
But now Python cannot find the module any longer. For example:
cd ~/test
python -c 'import inspect; import xyz; print(inspect.getfile(xyz))'
With output:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'xyz'
Questions:
- Where does Python register the location of modules?
- How can I update the registry to the new location of the module?