简体   繁体   中英

can't install numpy package in pycharm with latest pycharm and python 2.7

I installed Python 2.7, Pycharm 2017.3 and in pycharm in

settings > project interpreter > add package

I searched for numpy and installed the package but I get this error:

错误

Error occured:
    _configtest.c(7): error C2143: syntax error: missing ';' before 'volatile'

Proposed 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
  'C:\Users\Admin\PycharmProjects\second\venv\Scripts\python.exe'.

I tried by reinstalling everything but it didn't work.

I suppose that you are trying to install numpy on windows.
On windows, install this package could be quite complicated, so my suggestion is to use an unofficial installer for Numpy.

Here you can find the link with all unofficial installers, please search and open the Numpy link in the list.

Keep in mind to choose the right version, in this way:

  1. cp = python version (ie cp27 = Pythonv2.7)
  2. win_amd64 = x86_64 or win32 = windows 32 bit

Download it and then install it with the following command

pip install --user <numpy.whl>

for example, the following command install numpy v.1.13.3, for Python2.7 and for windowns 32:

pip install --user numpy‑1.13.3+mkl‑cp27‑cp27m‑win32.whl

Solved on Pycharm Pro and Comunity Edition

This is about near deprecation python 2.7, and dependencies requires older versions.

***File > Settings > project interpreter > Double Click to pip package > Check Specify version to 9.0.1 (downgrade version to older). Click to install package.

***File > Settings > project interpreter > Add package (+) > Search and select matplotlib > Check Specify version to 1.5.3 (Downgrade to older). Click install package.

Regards. ;-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM