You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @hema-ted, I am naively following the recommended installation method. After I successfully installed pyzfs with pip install ., I encountered the following error when I tried to run the program:
% pyzfs --wfcfmt qbox --filename /Users/xwang/Programs/pyzfs/pyzfs/examples/o2_qbox_xml/o2.xml
Traceback (most recent call last):
File "/Users/xwang/anaconda3/bin/pyzfs", line 5, in <module>
from pyzfs.run import main
File "/Users/xwang/anaconda3/lib/python3.6/site-packages/pyzfs/run.py", line 8, in <module>
from .common.misc import parse_sys_argv
ModuleNotFoundError: No module named 'pyzfs.common'
From what I know, pip install . copies your local packages to site-packages and install from there. But it only copies those folders that are explicitly specified in the packages argument of setup(). Since packages=["pyzfs"], the subpackages of pyzfs were not copied.
Of course one can avoid my mistake by add the pyzfs source folder to PYTHONPATH. Or, you can save this step by either:
change your packages to include explicitly the subpackages like pyzfs.common, pyzfs.common.wfc, etc., or
use packages=find_packages() in setup(). This will automatically include all folders that contain the __init__.py file. And this will be especially useful if your program becomes large.
The text was updated successfully, but these errors were encountered:
Thanks for your comment. In commit 8914384 I used find_packages in setup.py, as you suggested. Now it seems like the code will work by directly executing "pip install ."
Hi @hema-ted, I am naively following the recommended installation method. After I successfully installed
pyzfs
withpip install .
, I encountered the following error when I tried to run the program:From what I know,
pip install .
copies your local packages tosite-packages
and install from there. But it only copies those folders that are explicitly specified in thepackages
argument ofsetup()
. Sincepackages=["pyzfs"]
, the subpackages ofpyzfs
were not copied.Of course one can avoid my mistake by add the
pyzfs
source folder toPYTHONPATH
. Or, you can save this step by either:packages
to include explicitly the subpackages likepyzfs.common
,pyzfs.common.wfc
, etc., orpackages=find_packages()
insetup()
. This will automatically include all folders that contain the__init__.py
file. And this will be especially useful if your program becomes large.The text was updated successfully, but these errors were encountered: