Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install python module: PyCharm Error: "byte-compiling is disabled, skipping"

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)
like image 367
Afflatus Avatar asked Mar 03 '16 19:03

Afflatus


2 Answers

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

like image 106
Karel Muñiz Perdomo Avatar answered Oct 17 '22 20:10

Karel Muñiz Perdomo


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)

like image 8
Afflatus Avatar answered Oct 17 '22 21:10

Afflatus