Poetry: Equivalent of pip install --no-binary

Created on 1 Aug 2018  路  11Comments  路  Source: python-poetry/poetry

  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] I have searched the documentation and believe that my question is not covered.

Question


How can I specify that I don't want the binary package to be installed, ie. the equivalent of pip install --no-binary?

Configuration Feature

Most helpful comment

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.

All 11 comments

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.

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:

  1. Is this currently the best practice?
  2. Is there any method of configuring this via pyproject.toml, poetry.lock, or poetry.toml ?
  3. Are there any discussions in the Poetry namespace or https://github.com/pypa namespace to follow which might provide an answer to # 1 or # 2 ?

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ulope picture ulope  路  3Comments

etijskens picture etijskens  路  3Comments

jackemuk picture jackemuk  路  3Comments

AWegnerGitHub picture AWegnerGitHub  路  3Comments

probablykasper picture probablykasper  路  3Comments