因此,我使用Linux Mint mate已有一段时间了,并且一切正常。 因此,当我得到一个新笔记本时,我在Windows 10旁边安装了新版本的linux mint(19.2-Tina)。
现在,我正在尝试使其准备就绪,并且无法正常工作。
据说这两个版本的python都附带了:
Python 2.7.15以上
的Python 3.6.8
但是,当我尝试运行一个简单的hello世界但为我导入Essentials程序包时,类似以下内容
import numpy as np
import math #as ma
import matplotlib.pyplot as plt; plt.switch_backend('agg')
import sys
import pandas as pd
import seaborn as sns; sns.set()
import powerlaw as pl
from itertools import zip_longest
import csv
import os
print('hello world')
它甚至不识别numpy包,我得到了以下信息:
Traceback (most recent call last):
File "testes.py", line 1, in
import numpy as np
ModuleNotFoundError: No module named 'numpy'
所以我去了这个网站,并尝试按照教程
但是,当我尝试安装numpy时,结果如下所示:
(tutorial_env) jheniffer@jheniffer-5480:~/Dropbox/teste_cros_bi$ pip install python3-numpy
Collecting python3-numpy
Exception:
Traceback (most recent call last):
File "/home/jheniffer/Dropbox/teste_cros_bi/tutorial_env/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/jheniffer/Dropbox/teste_cros_bi/tutorial_env/lib/python3.6/site-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/home/jheniffer/Dropbox/teste_cros_bi/tutorial_env/lib/python3.6/site-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/home/jheniffer/Dropbox/teste_cros_bi/tutorial_env/lib/python3.6/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/home/jheniffer/Dropbox/teste_cros_bi/tutorial_env/lib/python3.6/site-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/home/jheniffer/Dropbox/teste_cros_bi/tutorial_env/lib/python3.6/site-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/home/jheniffer/Dropbox/teste_cros_bi/tutorial_env/lib/python3.6/site-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/home/jheniffer/Dropbox/teste_cros_bi/tutorial_env/lib/python3.6/site-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/home/jheniffer/Dropbox/teste_cros_bi/tutorial_env/lib/python3.6/site-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/home/jheniffer/Dropbox/teste_cros_bi/tutorial_env/lib/python3.6/site-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/home/jheniffer/Dropbox/teste_cros_bi/tutorial_env/lib/python3.6/site-packages/pip/index.py", line 795, in get_page
resp.raise_for_status()
File "/home/jheniffer/Dropbox/teste_cros_bi/tutorial_env/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/models.py", line 935, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://pypi.org/simple/python3-numpy/
我不知道该怎么做才能使它运行,我应该如何继续安装所有内容,因为我认为已经安装了基本软件包(例如numpy),并且每隔一次尝试通过pip进行安装(在我以前的笔记本电脑上)只能与
pip3 install python3-numpy
我尝试了没有pip的选项,安装成功
(tutorial_env) jheniffer@jheniffer-5480:~/Dropbox/teste_cros_bi$ sudo apt install python3-numpy
[sudo] password for jheniffer:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
gfortran python-numpy-doc python3-dev python3-nose python3-numpy-dbg
The following NEW packages will be installed:
python3-numpy
0 upgraded, 1 newly installed, 0 to remove and 287 not upgraded.
Need to get 1.943 kB of archives.
After this operation, 10,9 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic/main amd64 python3-numpy amd64 1:1.13.3-2ubuntu1 [1.943 kB]
Fetched 1.943 kB in 4s (528 kB/s)
Selecting previously unselected package python3-numpy.
(Reading database ... 308507 files and directories currently installed.)
Preparing to unpack .../python3-numpy_1%3a1.13.3-2ubuntu1_amd64.deb ...
Unpacking python3-numpy (1:1.13.3-2ubuntu1) ...
Setting up python3-numpy (1:1.13.3-2ubuntu1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
但是,当我尝试运行hello字代码时,我又收到了此消息
(tutorial_env) jheniffer@jheniffer-5480:~/Dropbox/teste_cros_bi$ python3 testes.py
Traceback (most recent call last):
File "testes.py", line 1, in
import numpy as np
ModuleNotFoundError: No module named 'numpy'