Skip to content

pip --no-cache-dir still warns about a cache folder #2762

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

Closed
lra opened this issue May 7, 2015 · 3 comments
Closed

pip --no-cache-dir still warns about a cache folder #2762

lra opened this issue May 7, 2015 · 3 comments
Labels
auto-locked Outdated issues that have been locked by automation
Milestone

Comments

@lra
Copy link

lra commented May 7, 2015

If I use the --no-cache-dir option, I expect it to not even try to figure out any cache, but you can see that it still does, and suggest to use sudo -H

$ sudo pip --no-cache-dir --disable-pip-version-check search glop
The directory '/home/ubuntu/.cache/pip/log' or its parent directory is not owned by the current user and the debug log has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
glopen     - Open-like interface to globus remotes
glopy      - Python library wrapping Globus Toolkit credential library

Verbose:

$ sudo pip --verbose --no-cache-dir --disable-pip-version-check search glop
The directory '/home/ubuntu/.cache/pip/log' or its parent directory is not owned by the current user and the debug log has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Starting new HTTPS connection (1): pypi.python.org
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
"POST /pypi HTTP/1.1" 200 None
glopen     - Open-like interface to globus remotes
glopy      - Python library wrapping Globus Toolkit credential library

Version:

$ pip --version
pip 6.1.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)
@dstufft
Copy link
Member

dstufft commented May 7, 2015

That's because on some operating systems the log directory is a sub-directory of the cache directory (but not on others). I'm not sure what the right answer is- on one hand on systems where the log dir is a subdir of the cache dir it can often make sense to turn off logging when --no-cache-dir is used (though maybe not always? Someone might just be trying to disable caching), on the other hand doing that is a little confusing on platforms where the log dir isn't in the cache dir.

@ianwestcott
Copy link

In attempting to find a workaround for this warning, I noticed that it appears even if the log directory is explicitly set to something else using the --log argument:

# search for a package, with cache disabled and log sent to /dev/null
vagrant@hotlanta:/percolate/hotlanta$ sudo pip --no-cache-dir --log /dev/null search ianw
The directory '/home/vagrant/.cache/pip/log' or its parent directory is not owned by the current user and the debug log has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
js.unicode_eastasianwidth     - Fanstatic packaging of Counting the unicode characters based Unicode East Asian Width database for JavaScript. It includes some tools for dealing with characters.

# version
vagrant@hotlanta:/percolate/hotlanta$ pip --version
pip 6.1.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)

While it may not be desirable to infer logging behavior based on the usage of the --no-cache-dir flag, it should at least be possible to redirect logging (or perhaps disable it with a --no-log-dir flag) to get around this problem.

@dstufft dstufft added this to the 7.0 milestone May 21, 2015
@lra
Copy link
Author

lra commented May 27, 2015

Thanks!

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

3 participants