7

I just installed PyCharm 5 for the first time and trying to get things working. I have a simple python script that tries to import pandas (import pandas as pd). It fails because the pandas isn't installed... So I go to install it and then get an error (copied below).

I tried looking for some "byte-compiling" setting in Preferences or Help but to no avail. I've already tried the workarounds suggested here involving changing the default project editor to Python 2.7, but that didn't help (https://github.com/spacy-io/spaCy/issues/114).

What do I do?

================= Error below =================
Executed command:"
/var/folders/kf/nd7950995gn25k6_xsh3tv6c0000gn/T/tmpgYwltUpycharm-management/pip-7.1.0/setup.py install

Error occurred:
40:357: execution error: warning: build_py: byte-compiling is disabled, skipping.

Command Output:
40:357: execution error: warning: build_py: byte-compiling is disabled, skipping.
warning: install_lib: byte-compiling is disabled, skipping.
error: byte-compiling is disabled.
 (1)
LazyOne
  • 158,824
  • 45
  • 388
  • 391
Afflatus
  • 2,302
  • 5
  • 25
  • 40

2 Answers2

19

For all who have the same problem, it took me a while to find the solution in a new installation of PyCharm 5.

The problem is you have to change the default interpreter that brings PyCharm 5(2.6 default). It is different from your python version system and the IDE.

Windows or Linux File -> Settings -> Project Interpreter

Mac PyCharm -> Preferences -> Project Interpreter

Select your python --version and then you can install all the modules you need with

pip install ModuleName

I recommend also add all the PATHs

Preferences -> Tools ->Terminal ->Shell path : echo $PATH

8

There are two parts which are pretty crucial:

  1. Changing the default project interpreter to Python 2.7*
  2. Making sure your CURRENT PROJECT is set to also use the Python 2.7. This isn't that straightforward and doesn't happen automatically even after you change the default. It also didn't work when when I initially changed my current project's interpreter to 2.7 either. It only worked once I DELETED the Python 2.6 interpreter, that it actually adjusted to the 2.7 version.

*(maybe it could work in 3.0... it certainly didn't work for me using 2.6)

Afflatus
  • 2,302
  • 5
  • 25
  • 40