pycharm安装numpy报错,怎么办?

pip版本应该没问题,我是在pycharm里搜到,它自动帮我装的,没什么问题
回复内容:
There are lots of bugs when you try to use 'pip install package' in windows.A better solution is go to http://www.lfd.uci.edu/~gohlke/pythonlibs/ and download your target packge. 花了好几个小时,终于解决这个问题了。现在贴出一篇刚写的博客,希望对其他人有帮助。
windows下如何快速优雅的使用python的科学计算库?
Python是一种强大的编程语言,其提供了很多用于科学计算的模块,常见的包括numpy、scipy、pandas和matplotlib。要利用Python进行科学计算,就需要一一安装所需的模块,而这些模块可能又依赖于其它的软件包或库,因而安装和使用起来相对麻烦。幸好有人专门在做这一类事情,将科学计算所需要的模块都编译好,然后打包以发行版的形式供用户使用,Anaconda就是其中一个常用的科学计算发行版。
我们从网站(链接1)下载的默认的Anaconda版本已经内置了很多库(链接2),包括numpy等。
尽管Anaconda已经自带了大量科学计算中的常用模块,可以直接使用。有时需要安装一些其他python模块。比如:
conda
anaconda自带了conda命令用于安装与更新模块,比如:
1 conda install scipy 2 conda update scipy


----------------------------------------------------------------------------------------------------------------------------
我来一版mac版的,PyCharm 安装 NumPy,SciPy 等科学计算包 (Anaconda)for mac OS X
又根据 @zhusleep 的回答修改了些。
适用性
如题啊,前一段时间学了些机器学习的东西,就想好好学下python,在10 款最好的 Python IDE中选来选去python IDE 还是选成了PyCharm ( JetBrains 开发的 Python IDE)。
所以,本文适用者:
- 喜欢或习惯使用PyCharm IDE, 或某一IDE
- 需要用python做科学计算/ 数据挖掘/ 机器学习/ 深度学习 (也就是说需要安装NumPy,SciPy 等科学计算包)的同学
- Mac OSX 系统
- 懒!!!Python安装Numpy、Scipy、Matlotlib、Scikit-learn等库的安装过程真是一把泪啊(用pip或其他方法),各种不兼容问题和报错,各模块可能又依赖于其它的软件包或库。自己安装起来那叫个麻烦!
-
如果只满足条件2和条件4,又是windows系统的的同学,强烈直接推荐 Python(x,y) :(暂时只有windows系统版本的 ,Spyder有Mac版的)
这个里面含Spyder,各种科学计算包以及工具,如果是初学者,一个在手,万事无忧了,就没有我这种IDE选择恐惧,及之后选安装包方法,选XXX等等的选择恐惧了。Python(x,y)的官方下载地址
Python(x,y)的其他下载地址 如果符合条件1,同我一样难以割舍 PyCharm的话,但是windows系统的话,其实跟我下面的过程差不多,只是到时候选择windows版的就好了
关键我是符合条件4,少走些弯路,少浪费些时间在配环境上,多些时间码代码吧O(∩_∩)O~
不符合条件4的,想经历这样的分娩过程的童鞋,参看一些别人的经验(参考文章):
[python] 安装numpy+scipy+matlotlib+scikit-learn及问题解决
Mac下用numpy,scipy,matplotlib,ipython进行数据分析:初始化环境
windows下如何快速优雅的使用python的科学计算库?
正因为条件4的原因,就有人将科学计算所需要的模块都编译好,然后打包以发行版的形式供用户使用,Anaconda就是其中一个常用的科学计算发行版。
Anaconda官网下载
选择自己的python版本号和 图形化安装/命令行安装 (我选的图形化安装),下载下来,双击开始安装就好了。如果选择命令行安装,按照上图(官网说明)的命令安装就好了。
如果不需要特定的IDE的话,用Anaconda带的spyder就可以了,不用往下看了。-
How to set up an IDE to use Anaconda 设置某IDE使用Anaconda(也是在Anaconda官方文档上)
包括:- Spyder
- Python Tools for Visual Studio (PTVS)
- PyCharm
- Eclipse & PyDev
- Wing IDE
- Ninja IDE
这里就简单为不想看英文的说一下PyCharm的配置
PyCharm’s Preferences -> Project Interpreter -> Add local -> 选择Anaconda安装所在的文件下的bin/python


apply -> OK

最后再推荐一些python 自学资料资源分享
|-- 工具类
|---10 款最好的 Python IDE 推荐pycharm
|--- Python(x,y) :(暂时只有windows系统版本的 ,Spyder有Mac版的) Python(x,y)的官方下载地址Python(x,y)的其他下载地址
适合科学计算,数据挖掘,机器学习。
Python(x,y) is a handy scientific and engineering development application specially designed for numerical computations, data analysis and data visualization.It is based on Python programming language, Qt graphical user interfaces, Eclipse integrated development environment and Spyder interactive scientific development environment. With Python(x,y), one can do: Interactive calculations including for example 2D and 3D plotting or symbolic maths, Simple functional programming (with MATLA.....
|--- Python Tutor 一个可视化编程的小工具,直观的看到每行代码在计算机中的执行过程。
helps people overcome a fundamental barrier to learning programming: understanding what happens as the computer executes each line of a program's source code.
Using this tool, you can write Python, Java, JavaScript, TypeScript, Ruby, C, and C++ programs in your Web browser and visualize what the computer is doing step-by-step as it executes those programs.
|-- 手册类
|--- Python官网
|--- W3shool 关于 Python 2.xx 版本技术文档
|---- 网页地址: Python 基础教程
|--- W3shool 关于 Python 3.xx 版本技术文档
|---- 网页地址: http://www.w3cschool.cc/python3/python3-tutorial.html
|---- 网盘地址(全套 W3shool pdf 文档): http://pan.baidu.com/s/1c0lMaYW
|--- Python 中文开发者网站 :PythonTab:Python中文开发者社区门户
|--- PyTab 在线手册中心 :PyTab在线手册中心
|--- WEB 开发者 Python 网站 :Python - WEB开发者
|--- Linux CentOS 中文网 : CentOS中文站
|--- Linux Study - Area : Study-Area
|--- 36 大数据知识分享网站 : 36大数据 | 关注大数据实际应用::中国大数据商业新媒体
|--- cnblog Python 快速教程(Vamei): Python快速教程
|-- 类库
|--- Python 机器学习类库: http://scikit-learn.org/stable/
|-- 书籍类
|--- Python 编程相关书籍下载 : http://pan.baidu.com/wap/link?uk=4228308634&shareid=586479154&third=0
|--- WEB 开发相关书籍下载 : http://yun.baidu.com/s/1jGmKgfG
|--- Magnus Lie Hetland,Beginning Python: from Novice to Professional, 2nd edition, Apress.(第二版中译版名为《Python基础教程》)
|--- Wesley Chun, Core Python Applications Programming, Prentice Hall.(第二版中译版名为《Python核心编程》)
|-- 视频类
|--- 可汗学院公开课:计算机科学
|---- 类 别:注重操作
|---- 网页地址: 可汗学院公开课:计算机科学
|--- 麻省理工学院公开课:计算机科学及编程导论
|---- 类 别:编程入门、程序理论
|---- 网页地址:麻省理工学院公开课:计算机科学及编程导论
|---- 网盘地址(MIT官方带文档):http://yun.baidu.com/s/1mg9OHbq
|---- 网盘地址(全视频版):http://yun.baidu.com/s/1c02F9ew
|--- 麻省理工学院公开课:算法导论
|---- 类 别:进阶学习 (适合有时间和喜欢算法的朋友)
|---- 网页地址:麻省理工学院公开课:算法导论
|---- 网盘地址:http://yun.baidu.com/s/1mg5f5xQ
|--- 哈尔滨工业大学:程序设计入门--Python(完结版)
|---- 类 别:本课程第一版,适合时间比较紧凑的朋友
|---- 网页地址:程序设计入门
|--- Coursera 慕课:用Python玩转数据 Data
|---- 类 别:利用Python方便快捷地获取数据、表示数据、分析数据和展示数据,通过多个案例让大家轻松愉快地学会用Python玩转各领域数据。
|---- 网页地址:https://www.coursera.org/learn/hipython/home/welcome
你需要的是Microsoft Visual C++ Compiler for Python 2.7
Visual C++ Compiler for Python 2.7 Windows 下安装需要编译的 Python 包真不容易。
如果经常需要搞科学计算,建议把整个 Python 卸载了,装 Anaconda 或 Miniconda。 pip install numpy
没有pip的话去装一个pip 大家答的都很好,我来总结一下。
就是 numpy 确实需要 msvc 2010 的编译器。
你可以去下它,也可以去下 numpy 的二进制 (with MKL)https://link.zhihu.com/?target=http%3A//www.lfd.uci.edu/%7Egohlke/pythonlibs/ 本主有编译好的包for winall Windows环境下用Numpy还是下编译过的比较方便。去这里(Numerical Python)下载合适的版本,安装就是了 http://www.lfd.uci.edu/~gohlke/pythonlibs/ 找需要的包,pip install xxx.whl就可以了

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Reasons for PyCharm to run slowly include: Hardware limitations: low CPU performance, insufficient memory, and insufficient storage space. Software related issues: Too many plugins, indexing issues, and large project sizes. Project configuration: Improper configuration of the Python interpreter, excessive file monitoring, and excessive resource consumption by the code analysis function.

To run an ipynb file in PyCharm: open the ipynb file, create a Python environment (optional), run the code cell, use an interactive environment.

Solutions to PyCharm crashes include: check memory usage and increase PyCharm's memory limit; update PyCharm to the latest version; check plug-ins and disable or uninstall unnecessary plug-ins; reset PyCharm settings; disable hardware acceleration; reinstall PyCharm; contact Support staff asked for help.

To remove the PyCharm interpreter: Open the Settings window and navigate to Interpreters. Select the interpreter you want to delete and click the minus button. Confirm the deletion and reload the project if necessary.

How to export Py files in PyCharm: Open the file to be exported, click the "File" menu, select "Export File", select the export location and file name, and click the "Export" button

Method to modify the Python interface to Chinese: Set the Python language environment variable: set PYTHONIOENCODING=UTF-8 Modify the IDE settings: PyCharm: Settings>Appearance and Behavior>Appearance>Language (Chinese); Visual Studio Code: File>Preferences>Search "locale" > Enter "zh-CN" to modify the system locale: Windows: Control Panel > Region > Format (Chinese (China)); macOS: Language and Region > Preferred Language (Chinese (Simplified) drag to the top of the list)

How to install the Pandas module using PyCharm: Open PyCharm, create a new project, and configure the Python interpreter. Enter the command pip install pandas in the terminal to install Pandas. Verify installation: Import pandas in PyCharm's Python script. If there are no errors, the installation is successful.

The menu bar in PyCharm provides quick access to various functions and options. To restore the menu bar: Click the View menu. Select the "Toolbar" option. Check the "Menu Bar" checkbox. Click OK. The menu bar contains the following menus: File, Edit, View, Navigate, Refactor, Run, Debug, Tools, VCS, Window, and Help.
