在Windows上安装matplotlib失败

2024-04-20 11:05:23 发布

您现在位置:Python中文网/ 问答频道 /正文

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

我下载了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

为了确定,我试着看看它是否已经安装好了。没有乐趣:

^{pr2}$

恐怕我更像一个Linux人,我真的不知道从哪里开始在Windows上进行故障排除。在

我错过了什么?在

所有的帮助都得到了感激。在

谢谢!在


Tags: pipinpymatplotliblibpackageslocalline