-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Using PIP_NO_CACHE_DIR raises exception #2897
Comments
I think you want |
Thanks for your reply, @dstufft.
However, what does "no cache dir = off" mean? I understand it means to use the cache dir... so I double check that it is caching:
But what I want is to disable the cache... and that doesn't work still:
IIRC |
|
Oh, so then in the presence of both |
I was having, right now, the same exception with the same backtrace but without specifying any of these env variables. I put a pdb.set_trace at the line 82 and could see that effectively the path value was 1 (the int, not the str).. after verify of my pip settings I've seen I had in my pip.conf : "no-cache-dir = true" ; changed it to "no-cache-dir = off" and there it's good.. But why was it failing sometimes and sometimes not :-? |
Tested this again on a temporary virtualenv, seems that all positive values ( $ pip list
pip (8.1.2)
setuptools (12.0.5)
(tmp-368ff30f354a8052) ✔ ~/openshift/src/github.com/openshift/source-to-image [master|…5⚑ 4]
22:34 $ PIP_NO_CACHE_DIR=1 pip install gunicorn
Exception:
Traceback (most recent call last):
File "/home/rodolfo/.virtualenvs/tmp-368ff30f354a8052/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/rodolfo/.virtualenvs/tmp-368ff30f354a8052/lib/python2.7/site-packages/pip/commands/install.py", line 249, in run
with self._build_session(options) as session:
File "/home/rodolfo/.virtualenvs/tmp-368ff30f354a8052/lib/python2.7/site-packages/pip/basecommand.py", line 69, in _build_session
if options.cache_dir else None
File "/home/rodolfo/.virtualenvs/tmp-368ff30f354a8052/lib64/python2.7/posixpath.py", line 70, in join
elif path == '' or path.endswith('/'):
AttributeError: 'int' object has no attribute 'endswith'
Traceback (most recent call last):
File "/home/rodolfo/.virtualenvs/tmp-368ff30f354a8052/bin/pip", line 11, in <module>
sys.exit(main())
File "/home/rodolfo/.virtualenvs/tmp-368ff30f354a8052/lib/python2.7/site-packages/pip/__init__.py", line 221, in main
return command.main(cmd_args)
File "/home/rodolfo/.virtualenvs/tmp-368ff30f354a8052/lib/python2.7/site-packages/pip/basecommand.py", line 251, in main
timeout=min(5, options.timeout)) as session:
File "/home/rodolfo/.virtualenvs/tmp-368ff30f354a8052/lib/python2.7/site-packages/pip/basecommand.py", line 69, in _build_session
if options.cache_dir else None
File "/home/rodolfo/.virtualenvs/tmp-368ff30f354a8052/lib64/python2.7/posixpath.py", line 70, in join
elif path == '' or path.endswith('/'):
AttributeError: 'int' object has no attribute 'endswith' $ PIP_NO_CACHE_DIR= pip install gunicorn
Requirement already satisfied (use --upgrade to upgrade): gunicorn in /home/rodolfo/.virtualenvs/tmp-368ff30f354a8052/lib/python2.7/site-packages
$ PIP_NO_CACHE_DIR=0 pip install gunicorn
Requirement already satisfied (use --upgrade to upgrade): gunicorn in /home/rodolfo/.virtualenvs/tmp-368ff30f354a8052/lib/python2.7/site-packages |
If you explicitly want Note that, pip uses falsy values to enable boolean options like |
@asobrien thank you very much. I'm closing this as a usage error, thanks for pointing out the docs. |
For what it's worth, I'd like to say that is very confusing behaviour. Setting |
Since Werkzeug's version is hardcoded to a lower one in every Odoo supported version and fork, the easiest patch is to install it as odoo user, which will take precedence over the version installed by automated tools. Took the chance to use `$PIP_NO_CACHE_DIR=0` as explained in pypa/pip#2897 (comment) instead of adding `--no-cache-dir` everywhere. Fix #19
Since Werkzeug's version is hardcoded to a lower one in every Odoo supported version and fork, the easiest patch is to install it as odoo user, which will take precedence over the version installed by automated tools. Took the chance to use `$PIP_NO_CACHE_DIR=0` as explained in pypa/pip#2897 (comment) instead of adding `--no-cache-dir` everywhere. Fix #19
After going through this recently, have to agree that how these environment variables are set is very strange. It would be nice to see them fixed to be a bit more intuitive. |
I agree - could you file a new issue (or is there an existing one) for this, so that we can discuss this properly in a separate issue? |
Thanks @pradyunsg for the encouragement. Sorry for the delay. Have raised issue ( #5735 ). |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This is related to #2855 and #2856.
#2856 fixed the exception when using
--no-cache-dir
flag, but using the equivalent env var still doesn't work:The text was updated successfully, but these errors were encountered: