How can I specify that I don't want the binary package to be installed, ie. the equivalent of pip install --no-binary?
I would appreciate some clarity on this front as well. The currently recommended installation of psycopg2 is:
python3 -m pip install psycopg2>=2.7,<2.8 --no-binary psycopg2
What is the right way to install psycopg2 with Poetry?
Thanks!
This seems to work:
PIP_NO_BINARY="psycopg2" poetry install
Is there a solution with Poetry that involves a change to the pyproject.toml or something similar?
The team I work on is trying to install psycopg2 with --no-binary, and although I appreciate that your solution works well @rectalogic, it would be ideal if the solution wasn't co-ordinating that all developers on the team add an environment variable whenever executing poetry install (or update their local ~./bashrc, etc.).
I agree with @RevolutionTech that this should be an option for dependencies in pyproject.toml, a no-binary flag. If this is still something to be done, I'd be happy to come up with an implementation.
In the interest of full transparency I should mention that this is no longer an urgent need for the team I work on since modern versions of psycopg2 do not install the binary version by default anyways.
That said, I still think that this would be a really great feature, and I am sure there are other packages besides psycopg2 where this presents a problem.
Related / duplicate: https://github.com/python-poetry/poetry/issues/1316 ?
I ran into an issue with the neuralcoref library (github, pypi) which was solved by changing my workflow to PIP_NO_BINARY="neuralcoref" poetry install .
A few questions:
Related / duplicate: #1316 ?
Yes, indeed
I'm watching this issue as opencv-python requires --no-binary option in my case.
This is not a duplicate of #1316 since _this_ issue, as an install override, doesn't drag in the question of config files/lock file specifications, platform string matching, etc. There will always be systems that have nonstandard system libraries, patches, feature flags turned on/off that cause wheel incompatibility, where it doesn't make sense to force everyone to use source packages.
Another example, gevent==1.4.0 wheel doesn't work with new versions of Python 3.7 (Debian) due to binary incompatibility. Installing from source works, but PIP_NO_BINARY or other environment variables don't work. Manual fix is to pip remove gevent then install it manually with --no-binary after setting up the venv.
PIP_NO_BINARY environment variable no longer works since (1.10?) since file resolution is being resolved by Poetry itself no longer pip.
Most helpful comment
I agree with @RevolutionTech that this should be an option for dependencies in
pyproject.toml, ano-binaryflag. If this is still something to be done, I'd be happy to come up with an implementation.