Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python 3.5] Installation fails - Workaround avaible #24

Closed
MarvinTeichmann opened this issue Jan 24, 2018 · 1 comment
Closed

[Python 3.5] Installation fails - Workaround avaible #24

MarvinTeichmann opened this issue Jan 24, 2018 · 1 comment

Comments

@MarvinTeichmann
Copy link

When running 'python setup.py install' on my machine I get the error message below.

The error indicates, that the code of test/test.py fails. The reason for this is, that test loads the local module '.encoding' instead of the installed one. A possible workaround is to run python setup.py build_ext --inplace before running python setup.py install. This creates a compiled lib inside the local module.

I assume that the author has run the former command at some point, so that he does not run into the issue. I think however, that this should ether be documented [hacky solution], of fixed in the sense that test.py should load the installed module and not the local one.

<< python setup.py install
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
...
...
creating encoding.egg-info
writing encoding.egg-info/PKG-INFO
...
removing '/home/mifs/mttt2/.virtualenvs/pytorch/lib/python3.5/site-packages/encoding-0.1.0+01946d4-py3.5.egg-info' (and everything under it)
Copying encoding.egg-info to /home/mifs/mttt2/.virtualenvs/pytorch/lib/python3.5/site-packages/encoding-0.1.0+01946d4-py3.5.egg-info
running install_scripts
Traceback (most recent call last):
  File "test/test.py", line 11, in <module>
    import encoding
  File "/home/mifs/mttt2/workarea/github/PyTorch-Encoding/encoding/__init__.py", line 13, in <module>
    import encoding.nn
  File "/home/mifs/mttt2/workarea/github/PyTorch-Encoding/encoding/nn/__init__.py", line 11, in <module>
    from .encoding import *
  File "/home/mifs/mttt2/workarea/github/PyTorch-Encoding/encoding/nn/encoding.py", line 17, in <module>
    from .._ext import encoding_lib
  File "/home/mifs/mttt2/workarea/github/PyTorch-Encoding/encoding/_ext/encoding_lib/__init__.py", line 3, in <module>
    from ._encoding_lib import lib as _lib, ffi as _ffi
ImportError: No module named 'encoding._ext.encoding_lib._encoding_lib'
Traceback (most recent call last):
  File "setup.py", line 66, in <module>
    'install': install,
  File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "setup.py", line 26, in run
    subprocess.check_call("python test/test.py".split())
  File "/usr/lib/python3.5/subprocess.py", line 581, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['python', 'test/test.py']' returned non-zero exit status 1

@zhanghang1989
Copy link
Owner

I couldn't reproduce this error on my machine. I am closing it temporally. Feel free to reopen it if still having troubles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants