Closed stefsmeets closed 2 years ago
Hi Stef,
I think you should be able to import it as pyzacros
. How are you installing/importing it?
What works for me is
pip install -e .
on that folderpython -c "import pyzacros; print(pyzacros.__version__)"
should print out the version stringAlternatively
pip install -e git+https://github.com/SCM-NV/pyZacros.git#egg=pyzacros
To install without checking out manually, seems to work for me.
I think python setup.py install
should also work.
I installed it using pip install -e .
.
Did a little testing. Something in the python environment that we use within SCM software is making it work. However, using another environment I see the same issue as you are having. The issue seems to go away if I don't use the -e
flag. Can you try that instead?
Yeah, that does seem to work. I prefer to have it in editable mode (easier to update/debug that way). I think the offending line is this one: https://github.com/SCM-NV/pyZacros/blob/5856a07ac17dafca739eac556dc31b70bbbbb44e/setup.py#L8 Which does something funny during setup.
That particular line is working as intended. It seems that the package_dir
option is not really well supported in develop mode, from what I can gather by googling.
However, I found a way to get around it. I found that the following helped:
git clone git@github.com:SCM-NV/pyZacros.git pyzacros
pip install -e ./pyzacros
Note the lowercase name, like the package. Now, importing pyzacros
works for me.
I updated to the latest version and I noticed all my scripts are now broken. This seems to be a result of #64, which moves the entire package structure up one level. Now
__init__.py
and all modules are in the package root. Before they were in thepyzacros
subdirectory.This breaks all my code depending on pyzacros. Every statement such as:
Now becomes:
To me this is really odd in a python package. As a user, if I install
pyZacros
I'd expect to be able to import it aspyzacros
.But, I can also do:
from anywhere on my system. This can cause some really nasty issues with name collisions with other packages.
For now I will revert to the latest working version, but I hope this change can be reversed in a future update.