ReubenDo/InExtremIS

error: bad install directory or PYTHONPATH

Closed this issue · 2 comments

Thanks for your good paper and nice code.
When I ran python setup.py install --user, an error occurred:

running install
Checking .pth file support in /home/ubuntu/.local/lib/python3.8/site-packages/
/home/ubuntu/.venv/dl/bin/python -E -c pass
TEST FAILED: /home/ubuntu/.local/lib/python3.8/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from.  The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /home/ubuntu/.local/lib/python3.8/site-packages/

and your PYTHONPATH environment variable currently contains:

    ''

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is
  on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment
  variable.  (It must then also be on PYTHONPATH whenever you run
  Python and want to use the package(s) you are installing.)

* You can set up the installation directory to support ".pth" files by
  using one of the approaches described here:

  https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations


Please make the appropriate changes for your system and try again.

I discarded --user and ran python setup.py install. The installation looked normal:

running install
running bdist_egg
running egg_info
writing extensions.egg-info/PKG-INFO
writing dependency_links to extensions.egg-info/dependency_links.txt
writing top-level names to extensions.egg-info/top_level.txt
/home/ubuntu/.venv/dl/lib/python3.8/site-packages/torch/utils/cpp_extension.py:370: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
  warnings.warn(msg.format('we could not find ninja.'))
reading manifest file 'extensions.egg-info/SOURCES.txt'
writing manifest file 'extensions.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
creating build/bdist.linux-x86_64/egg
copying build/lib.linux-x86_64-3.8/HT_opp.cpython-38-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg
creating stub loader for HT_opp.cpython-38-x86_64-linux-gnu.so
byte-compiling build/bdist.linux-x86_64/egg/HT_opp.py to HT_opp.cpython-38.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying extensions.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying extensions.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying extensions.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying extensions.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
__pycache__.HT_opp.cpython-38: module references __file__
creating 'dist/extensions-0.0.0-py3.8-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing extensions-0.0.0-py3.8-linux-x86_64.egg
removing '/home/ubuntu/.venv/dl/lib/python3.8/site-packages/extensions-0.0.0-py3.8-linux-x86_64.egg' (and everything under it)
creating /home/ubuntu/.venv/dl/lib/python3.8/site-packages/extensions-0.0.0-py3.8-linux-x86_64.egg
Extracting extensions-0.0.0-py3.8-linux-x86_64.egg to /home/ubuntu/.venv/dl/lib/python3.8/site-packages
extensions 0.0.0 is already the active version in easy-install.pth

Installed /home/ubuntu/.venv/dl/lib/python3.8/site-packages/extensions-0.0.0-py3.8-linux-x86_64.egg
Processing dependencies for extensions==0.0.0
Finished processing dependencies for extensions==0.0.0

I notice that two installation directories are different. The former is /home/ubuntu/.local/lib/python3.8/site-packages/ which is an empty folder, and the latter is /home/ubuntu/.venv/dl/lib/python3.8/site-packages/which is my python virtual environment path. I wonder the function of --user and if my installation is correct. Thank you!

I don't think that it changes anything.

Are you able to import the CRF loss when you run the following command line?
python -c "from ScribbleDA.scribbleDALoss import CRFLoss"

I don't think that it changes anything.

Are you able to import the CRF loss when you run the following command line?
python -c "from ScribbleDA.scribbleDALoss import CRFLoss"

I tried this and the terminal showed nothing. It looks like the CRF loss works.