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

[BUG] pip install does not work #956

Closed
yueguoguo opened this issue Oct 17, 2019 · 2 comments
Closed

[BUG] pip install does not work #956

yueguoguo opened this issue Oct 17, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@yueguoguo
Copy link
Collaborator

Description

By following the instructions here, the pip install operation is successful but the package installed cannot be imported. The issue was reported here in the PR #851 but the solution does not resolve the issue.

Tried putting setup.py under the root of the repository, like the way that NLP and CV repositories do, there was another error as follows

Installing collected packages: reco-utils
  Found existing installation: reco-utils 2019.9
    Uninstalling reco-utils-2019.9:
      Successfully uninstalled reco-utils-2019.9
  Running setup.py develop for reco-utils
    ERROR: Command errored out with exit status 1:
     command: /data/anaconda/envs/graph_base/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/home/zhle/notebooks/recommenders/setup.py'"'"'; __file__='"'"'/data/home/zhle/notebooks/recommenders/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
         cwd: /data/home/zhle/notebooks/recommenders/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/data/home/zhle/notebooks/recommenders/setup.py", line 8, in <module>
        VERSION = __import__("__init__").VERSION
    ModuleNotFoundError: No module named '__init__'
    ----------------------------------------
  Rolling back uninstall of reco-utils
  Moving to /data/anaconda/envs/graph_base/lib/python3.6/site-packages/reco-utils.egg-link
   from /tmp/pip-uninstall-t38y7r7p/reco-utils.egg-link
ERROR: Command errored out with exit status 1: /data/anaconda/envs/graph_base/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/home/zhle/notebooks/recommenders/setup.py'"'"'; __file__='"'"'/data/home/zhle/notebooks/recommenders/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

Comment the line of VERSION = __import__("__init__").VERSION it worked, and importing of reco_utils is successful.

In which platform does it happen?

The error can be replicated on a DSVM by following the pip install instruction in here.

How do we replicate the issue?

Same as above

Expected behavior (i.e. solution)

The reco_utils should be imported without issue after pip installation.

Other Comments

@yueguoguo yueguoguo added the bug Something isn't working label Oct 17, 2019
@yueguoguo
Copy link
Collaborator Author

@gramhagen not sure if it is something to do with subdirectory functionality of pip install from github, but putting the setup.py under root directory of the repo solves the problem.

@gramhagen
Copy link
Collaborator

ok, yeah this simplifies the install from git too. should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants