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

Trouble installing from local repo or git #437

Closed
IanEisenberg opened this issue Dec 23, 2020 · 6 comments
Closed

Trouble installing from local repo or git #437

IanEisenberg opened this issue Dec 23, 2020 · 6 comments

Comments

@IanEisenberg
Copy link

While I can successfully install implicit via pip install implicit, I am struggling to install via git (pip install git+https://github.com/benfred/implicit.git) or locally (pip install -e [implicit loc]). In both cases I get an error related to Cython (ModuleNotFoundError: No Module named 'Cython'). Full error reproduced below.

I am using conda, but installing with pip. Cython is certainly installed. I have ensured that I am using the correct pip, have tried python -m pip install, as well as installing outside of any conda environment. Any help would be appreciated!

For context, I would like to be able to do this so that I can add functionality similar to #310

ERROR: Command errored out with exit status 1:
command: /Users/ianeisenberg/miniconda3/envs/test/bin/python /Users/ianeisenberg/miniconda3/envs/test/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /var/folders/q8/tx8j565j1x7_l8c0vcxg69rm0000gn/T/tmpaeq3oatz
cwd: /Users/ianeisenberg/tmp/implicit
Complete output (18 lines):
Traceback (most recent call last):
File "/Users/ianeisenberg/miniconda3/envs/test/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in
main()
File "/Users/ianeisenberg/miniconda3/envs/test/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/Users/ianeisenberg/miniconda3/envs/test/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 114, in get_requires_for_build_wheel
return hook(config_settings)
File "/private/var/folders/q8/tx8j565j1x7_l8c0vcxg69rm0000gn/T/pip-build-env-eu2susid/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 150, in get_requires_for_build_wheel
config_settings, requirements=['wheel'])
File "/private/var/folders/q8/tx8j565j1x7_l8c0vcxg69rm0000gn/T/pip-build-env-eu2susid/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 130, in _get_build_requires
self.run_setup()
File "/private/var/folders/q8/tx8j565j1x7_l8c0vcxg69rm0000gn/T/pip-build-env-eu2susid/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 254, in run_setup
self).run_setup(setup_script=setup_script)
File "/private/var/folders/q8/tx8j565j1x7_l8c0vcxg69rm0000gn/T/pip-build-env-eu2susid/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 145, in run_setup
exec(compile(code, file, 'exec'), locals())
File "setup.py", line 8, in
from Cython.Build import cythonize
ModuleNotFoundError: No module named 'Cython'


ERROR: Command errored out with exit status 1: /Users/ianeisenberg/miniconda3/envs/test/bin/python /Users/ianeisenberg/miniconda3/envs/test/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /var/folders/q8/tx8j565j1x7_l8c0vcxg69rm0000gn/T/tmpaeq3oatz Check the logs for full command output.

@benfred
Copy link
Owner

benfred commented Jan 21, 2021

I'm guessing your Cython installation is messed up . Maybe try pip3 install Cython --upgrade ?

Alternately it looks like your running conda - and we have prebuilt conda packages up on conda-forge. The advantage here is that you won't have to build the source yourself, you can just install the package with conda install -c conda-forge implicit

@emrecncelik
Copy link

Having the same problem here but with virtualenv and pip, not conda. I tried upgrading Cython pip install Cython --upgrade, but it did not work for me. I can import Cython within the same enviroment in any other file except for this one. Also tried upgrading setuptools and pep517 to see if they were the problem, I guess they weren't.

Some info about the versions I'm using in case anyone wants to know:

  • python 3.6.12 (also tried with 3.8 and 3.5)
  • virtualenv 20.0.17
  • pip 20.0.2
  • cython 0.29.21 (also tried with older versions)

I could not use random_state with train_test_split and other new functionality when I installed with pip install implicit (0.4.4), that's why I wanted to install from source too.

Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: /home/emrecan/python-env/recommendation/bin/python /home/emrecan/python-env/recommendation/lib/python3.5/site-packages/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmptbp9urur
cwd: /home/emrecan/workspace/work/recommendation/implicit
Complete output (18 lines):
Traceback (most recent call last):
File "/home/emrecan/python-env/recommendation/lib/python3.5/site-packages/pep517/_in_process.py", line 280, in
main()
File "/home/emrecan/python-env/recommendation/lib/python3.5/site-packages/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/emrecan/python-env/recommendation/lib/python3.5/site-packages/pep517/_in_process.py", line 114, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-jvq0bs95/overlay/lib/python3.5/site-packages/setuptools/build_meta.py", line 150, in get_requires_for_build_wheel
config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-jvq0bs95/overlay/lib/python3.5/site-packages/setuptools/build_meta.py", line 130, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-jvq0bs95/overlay/lib/python3.5/site-packages/setuptools/build_meta.py", line 254, in run_setup
self).run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-jvq0bs95/overlay/lib/python3.5/site-packages/setuptools/build_meta.py", line 145, in run_setup
exec(compile(code, file, 'exec'), locals())
File "setup.py", line 8, in
from Cython.Build import cythonize
ImportError: No module named 'Cython'

@GabrielBianconi
Copy link

I am having the same issue, both using conda and pyenv, with Cython installed on both.

@benfred
Copy link
Owner

benfred commented Aug 29, 2021

Can you try with the latest release (0.4.8) ? I've changed how Cython is bundled to hopefully fix this

@emrecncelik
Copy link

Worked for me, thank you.

@benfred
Copy link
Owner

benfred commented Aug 31, 2021

Thanks for verifying @emrecncelik -

@benfred benfred closed this as completed Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants