在Windows上安装matplotlib失败

时间:2017-04-11 15:30:45

标签: python windows matplotlib python-3.6

我需要能够在Widows笔记本电脑上使用matplotlib和Python。我在win32上有Python 3.6.1(v3.6.1:69c0db5,2017年3月21日,17:54:52)[MSC v.1900 32位(英特尔)]。

我下载了matplotlib-2.0.0-cp36-cp36m-win32.whl 来自https://pypi.python.org/pypi/matplotlib

当我尝试使用pip安装它时,结果是:

N:\ICT\Python\Projects>dir
 Volume in drive N is Offline

 Directory of N:\ICT\Python\Projects

11/04/2017  14:02    <DIR>          .
11/04/2017  14:02    <DIR>          ..
11/04/2017  14:01         8,802,610 matplotlib-2.0.0-cp36-cp36m-win32.whl
               1 File(s)      8,810,802 bytes
               2 Dir(s)  109,793,890,304 bytes free

N:\ICT\Python\Projects>python -m pip install --user matplotlib-2.0.0-cp36-cp36m-win32.whl

Processing n:\ict\python\projects\matplotlib-2.0.0-cp36-cp36m-win32.whl
Collecting pytz (from matplotlib==2.0.0)
  Downloading pytz-2017.2-py2.py3-none-any.whl (484kB)
    100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 491kB 204kB/s
Collecting six>=1.10 (from matplotlib==2.0.0)
  Downloading six-1.10.0-py2.py3-none-any.whl
Collecting numpy>=1.7.1 (from matplotlib==2.0.0)
  Downloading numpy-1.12.1-cp36-none-win32.whl (6.7MB)
    100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 6.7MB 14kB/s
Collecting python-dateutil (from matplotlib==2.0.0)
  Downloading python_dateutil-2.6.0-py2.py3-none-any.whl (194kB)
    100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 194kB 355kB/s
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6 (from matplotlib==2.0.0)
  Downloading pyparsing-2.2.0-py2.py3-none-any.whl (56kB)
    100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 61kB 516kB/s
Collecting cycler>=0.10 (from matplotlib==2.0.0)
  Downloading cycler-0.10.0-py2.py3-none-any.whl
Installing collected packages: pytz, six, numpy, python-dateutil, pyparsing, cycler, matplotlib
Exception:
Traceback (most recent call last):
  File "C:\Users\myname\AppData\Local\Programs\Python\Python36-32\lib\shutil.py", line 544, in move
    os.rename(src, real_dst)
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'N:\\My Settings\\Application Data\\Python\\Python36\\site-packages\\pytz-20
17.2.dist-info\\RECORD.pip' -> 'N:\\My Settings\\Application Data\\Python\\Python36\\site-packages\\pytz-2017.2.dist-info\\RECORD'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\myname\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\Users\myname\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\commands\install.py", line 342, in run
    prefix=options.prefix_path,
  File "C:\Users\myname\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\req\req_set.py", line 784, in install
    **kwargs
  File "C:\Users\myname\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\req\req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "C:\Users\myname\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "C:\Users\myname\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\wheel.py", line 527, in move_wheel_files
    shutil.move(temp_record, record)
  File "C:\Users\myname\AppData\Local\Programs\Python\Python36-32\lib\shutil.py", line 558, in move
    copy_function(src, real_dst)
  File "C:\Users\myname\AppData\Local\Programs\Python\Python36-32\lib\shutil.py", line 257, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "C:\Users\myname\AppData\Local\Programs\Python\Python36-32\lib\shutil.py", line 104, in copyfile
    raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
shutil.SameFileError: 'N:\\My Settings\\Application Data\\Python\\Python36\\site
-packages\\pytz-2017.2.dist-info\\RECORD.pip' and 'N:\\My Settings\\Application
Data\\Python\\Python36\\site-packages\\pytz-2017.2.dist-info\\RECORD' are the same file

而且,为了确定,我试着看看它是否已安装。没有快乐:

N:\ICT\Python\Projects>python
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)]
 on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'matplotlib'

我担心自己不再是Linux人,而且我真的不知道从哪里开始在Windows上进行故障排除。

我错过了什么?

感谢所有的帮助。

谢谢!

0 个答案:

没有答案