0

Using Pycharm, I am trying to install Pygall, which needs lxml and cairosvg. I created a 'requirements.txt' file to list the modules:

Executed command :

pip install lxml

Error:

0:425: execution error: The directory '/Users/romain/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

Output :

0:425: execution error: The directory '/Users/romain/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
You are using pip version 7.1.0, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The directory '/Users/romain/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: 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
Command "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools, tokenize;__file__='/private/var/folders/ml/g1gqdlfs4k36b_rpfk44hfrm0000gn/T/pycharm-packaging11.tmp/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/ml/g1gqdlfs4k36b_rpfk44hfrm0000gn/T/pip-DMEwQL-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/ml/g1gqdlfs4k36b_rpfk44hfrm0000gn/T/pycharm-packaging11.tmp/lxml (1)

Pycharm propose me a solution :

Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at '/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7'.

I tried to install from command line, but then I get an 'already satisfied' message :

$ pip install lxml
Requirement already satisfied (use --upgrade to upgrade): lxml in ./anaconda/lib/python2.7/site-packages

So I guess I have to change of user inside Pycharm... How can I do that ? In the pop up I tried to change my full name (first + family name) by just my first name (which I use as sudo account), but I got the same error...

Romain Jouin
  • 4,448
  • 3
  • 49
  • 79

1 Answers1

0

sudo pip install lxml should work to remove any permission issues on Linux

If you're on a Windows machine right click the command prompt and select 'run as administrator' then execute the pip install command.

  • Given the path `/Users/romain/Library/Caches/pip/http` he is on OS X hence he should use the Linux (in fact, universal *nix) solution – Eli Korvigo Sep 09 '15 at 23:43
  • The question is how to do that inside Pycharm ... Making a sudo pip install on the command line already tell me the package is installed. I guess Pycharm is using a kind of virtualenv somewhere, or using a session-specific user ... where is it defined, and how to change it ?? – Romain Jouin Sep 10 '15 at 09:14
  • @romainjouin By default PyCharm doesn't create or use any virtual Python environments. – Eli Korvigo Sep 10 '15 at 23:41
  • I realised I installed python through anaconda, and I have now several pythohn2.7 interpreters in my laptop... Pycharm is not using the good ones for pip : I had to change the project python interpreter to solve the issue :) – Romain Jouin Sep 11 '15 at 13:40