Comments (33)
你先按 Control+C 中断执行,然后重新运行下这几个命令:
cd /usr/local
sudo chown -R sunny:admin *
brew install python
from pilot.
请你运行下面几个命令,把结果截给我看看:
brew doctor
brew update
which python
which python3
which pip
which pip3
from pilot.
update那行没反应我就退出来了
from pilot.
from pilot.
先不管 brew update,这个需要联网,先把后面四个运行一下,结果给我看看。
from pilot.
Last login: Wed Oct 23 19:49:33 on ttys000
The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh
.
For more details, please visit https://support.apple.com/kb/HT208050.
192:~ sunny$ which python
/usr/bin/python
192:~ sunny$ which python3
/usr/local/bin/python3
192:~ sunny$ which pip
/usr/local/bin/pip
192:~ sunny$ which pip3
/usr/local/bin/pip3
192:~ sunny$
from pilot.
好的,继续,运行下面几个命令,给我看看结果:
python -V
python3 -V
pip -V
pip3 -V
from pilot.
Last login: Wed Oct 23 19:51:06 on ttys000
The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh
.
For more details, please visit https://support.apple.com/kb/HT208050.
192:~ sunny$ python -V
Python 2.7.16
192:~ sunny$ python3 -V
Python 3.7.4
192:~ sunny$ pip -V
pip 19.3.1 from /Library/Python/2.7/site-packages/pip-19.3.1-py2.7.egg/pip (python 2.7)
192:~ sunny$ pip3 -V
pip 19.3.1 from /Library/Python/2.7/site-packages/pip-19.3.1-py2.7.egg/pip (python 2.7)
192:~ sunny$
from pilot.
为什么你的 pip 和 pip3 都在 /usr/local/bin 下面(应该来自 Homebrew 安装),指向的库却在系统自带的老 Python 2.7 呢?
你是严格按照 环境配置指南 用 Homebrew 安装的 Python 3.7.4 吗?
from pilot.
请你执行下面两个命令,把结果截给我看:
cd /usr/local/bin
ls -l pip* python*
from pilot.
192:~ sunny$ cd /usr/local/bin
192:bin sunny$ ls -l pip* python*
-rwxr-xr-x 1 root admin 448 10 23 11:40 pip
-rwxr-xr-x 1 root admin 450 10 23 11:40 pip3
-rwxr-xr-x 1 root admin 454 10 23 11:40 pip3.7
lrwxr-xr-x 1 sunny admin 36 10 23 10:22 python3 -> ../Cellar/python/3.7.4_1/bin/python3
lrwxr-xr-x 1 sunny admin 43 10 23 10:22 python3-config -> ../Cellar/python/3.7.4_1/bin/python3-config
lrwxr-xr-x 1 sunny admin 38 10 23 10:22 python3.7 -> ../Cellar/python/3.7.4_1/bin/python3.7
lrwxr-xr-x 1 sunny admin 45 10 23 10:22 python3.7-config -> ../Cellar/python/3.7.4_1/bin/python3.7-config
lrwxr-xr-x 1 sunny admin 39 10 23 10:22 python3.7m -> ../Cellar/python/3.7.4_1/bin/python3.7m
lrwxr-xr-x 1 sunny admin 46 10 23 10:22 python3.7m-config -> ../Cellar/python/3.7.4_1/bin/python3.7m-config
192:bin sunny$
from pilot.
你似乎以前用别的方法安装过 Python 2.x,所以上面的几个 pip 文件的 owner 是 root,于是 Homebrew 安装时无法覆盖这些文件,所以环境目前是乱的。
你能不能回忆起之前是怎么安装 Python 2.x 的?最好将其完整清除,然后再用 Homebrew 重装一次 python。
也有比较粗暴的办法,尝试依次执行下面的命令:
cd /usr
sudo chown -R sunny:admin local
brew uninstall python
brew install python
from pilot.
可能是我当时走到最后一步发现有问题,就胡乱百度,胡乱输入了一些命令。。。
现在就按粗暴办法整,呵呵,但好像最后一行命令写了又是没反应的状态了,汗。。。
lrwxr-xr-x 1 sunny admin 46 10 23 10:22 python3.7m-config -> ../Cellar/python/3.7.4_1/bin/python3.7m-config
192:bin sunny$
192:bin sunny$ cd /usr
192:usr sunny$ sudo chown -R sunny:admin local
Password:
chown: local: Operation not permitted
192:usr sunny$ brew uninstall python
Uninstalling /usr/local/Cellar/python/3.7.4_1... (3,958 files, 60.7MB)
192:usr sunny$ brew install python
Updating Homebrew...
from pilot.
这个只要不报错,就是在更新 Homebrew,等吧。
from pilot.
你前面的 sudo chown -R sunny:admin local
应该没有运行成功,因为报了 chown: local: Operation not permitted
。
等下应该还是有问题的。
from pilot.
老师 我早上安装jupyterlab也遇到了类似的问题,请问需要怎么解决呢?
from pilot.
@Jared-Gong 你这个是网络问题,多试试吧。
from pilot.
from pilot.
@Jared-Gong 你这个是别的问题,请你重新开一个 issue。
from pilot.
@Jared-Gong 你这个是网络问题,多试试吧。
老师 这个安装 需要开VPN吧,下载速度是几KB/s 然后就显示这个错误了
from pilot.
@zhangSen1987 如果网络不好最好开代理。另外这个 issue 的原问题已经解决,有其他问题请开新 issue。
from pilot.
@sunyan023 帮你贴一下
192:usr sunny$ cd /usr/local
192:local sunny$ sudo chown -R sunny:admin *
192:local sunny$ brew install python
Updating Homebrew...
Warning: python 3.7.4_1 is already installed and up-to-date
To reinstall 3.7.4_1, run brew reinstall python
192:local sunny$
这样的话,你就运行 brew reinstall python
试试。
from pilot.
麻烦看一下,这是运行brew reinstall python后的显示:
192:local sunny$ brew reinstall python
==> Reinstalling python
==> Downloading https://homebrew.bintray.com/bottles/python-3.7.4_1.catalina.bot
Already downloaded: /Users/sunny/Library/Caches/Homebrew/downloads/1950aa3ee7562c8f28bc45dc2f27c5a7a2e5b864afd5818f3e7cc55ca24499d4--python-3.7.4_1.catalina.bottle.1.tar.gz
==> Pouring python-3.7.4_1.catalina.bottle.1.tar.gz
==> /usr/local/Cellar/python/3.7.4_1/bin/python3 -s setup.py --no-user-cfg insta
==> /usr/local/Cellar/python/3.7.4_1/bin/python3 -s setup.py --no-user-cfg insta
==> /usr/local/Cellar/python/3.7.4_1/bin/python3 -s setup.py --no-user-cfg insta
==> Caveats
Python has been installed as
/usr/local/bin/python3
Unversioned symlinks python
, python-config
, pip
etc. pointing to
python3
, python3-config
, pip3
etc., respectively, have been installed into
/usr/local/opt/python/libexec/bin
If you need Homebrew's Python 2.7 run
brew install python@2
You can install Python packages with
pip3 install
They will install into the site-package directory
/usr/local/lib/python3.7/site-packages
See: https://docs.brew.sh/Homebrew-and-Python
==> Summary
192:local sunny$
from pilot.
看上去是安装成功了,你可以执行下面的命令来确认下:
python3 -V
pip3 -V
如果没有问题,从现在开始你可以用 python3 来运行 Python,用 pip3 来安装 Python 的各种软件包。
接着运行下面的命令来安装 Jupyter Lab:
pip3 install -U pip
pip3 install jupyterlab
from pilot.
好像还是有点问题
192:local sunny$ python3 -V
Python 3.7.4
192:local sunny$ pip3 -V
pip 19.2.3 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
192:local sunny$ pip3 install -U pip
Collecting pip
Downloading https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl (1.4MB)
|▊ | 30kB 1.4kB/s eta 0:16:55ERROR: Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 397, in _error_catcher
yield
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 479, in read
data = self._fp.read(amt)
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 457, in read
n = self.readinto(b)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 501, in readinto
n = self.fp.readinto(b)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socket.py", line 589, in readinto
return self._sock.recv_into(b)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 1071, in recv_into
return self.read(nbytes, buffer)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 929, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 188, in main
status = self.run(options, args)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 345, in run
resolver.resolve(requirement_set)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 196, in resolve
self._resolve_one(requirement_set, req)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 359, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 307, in _get_abstract_dist_for
self.require_hashes
File "/usr/local/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 199, in prepare_linked_requirement
progress_bar=self.progress_bar
File "/usr/local/lib/python3.7/site-packages/pip/_internal/download.py", line 1064, in unpack_url
progress_bar=progress_bar
File "/usr/local/lib/python3.7/site-packages/pip/_internal/download.py", line 924, in unpack_http_url
progress_bar)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/download.py", line 1152, in _download_http_url
_download_url(resp, link, content_file, hashes, progress_bar)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/download.py", line 861, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/utils/hashes.py", line 75, in check_against_chunks
for chunk in chunks:
File "/usr/local/lib/python3.7/site-packages/pip/_internal/download.py", line 829, in written_chunks
for chunk in chunks:
File "/usr/local/lib/python3.7/site-packages/pip/_internal/utils/ui.py", line 156, in iter
for x in it:
File "/usr/local/lib/python3.7/site-packages/pip/_internal/download.py", line 818, in resp_read
decode_content=False):
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 531, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 496, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 130, in exit
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 402, in _error_catcher
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
192:local sunny$ pip3 install jupyterla
Collecting jupyterla
ERROR: Could not find a version that satisfies the requirement jupyterla (from versions: none)
ERROR: No matching distribution found for jupyterla
ç192:local sunny$
192:local sunny$ ç
192:local sunny$ cd Code
-bash: cd: Code: No such file or directory
192:local sunny$ mkdir Code
mkdir: Code: Permission denied
192:local sunny$
from pilot.
前面运行 pip3 install -U pip
因为网络问题没有成功完成。
而后面安装 jupyterlab 的命令输错了。
不要急,慢慢来,看清楚自己输入了什么,知道自己在做啥,也学会了解计算机说了啥,不然就是浪费时间。
from pilot.
运行好几次这个命令,但还是出现一片红色,肿么办?我去复制粘贴网址下载可行吗?
192:local sunny$ pip3 install -U pip
Collecting pip
Downloading https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl (1.4MB)
ERROR: Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 397, in _error_catcher
from pilot.
这个是网络的问题,试试换别的网络或者代理。
from pilot.
pip安装好啦,耶
Successfully installed pip-19.3.1
192:local sunny$ pip3 install jupyterlab
Collecting jupyterlab
Downloading https://files.pythonhosted.org/packages/2c/89/a4e048f198867f19d2a9f40d08c946d760ab06dd39d774940a20da47b5f9/jupyterlab-1.1.4-py2.py3-none-any.whl (15.3MB)
|█████████ | 4.3MB 4.4kB/s eta 0:41:15ERROR: Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 425, in _error_catcher
yield
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 507, in read
data = self._fp.read(amt) if not fp_closed else b""
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 457, in read
n = self.readinto(b)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 501, in readinto
n = self.fp.readinto(b)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socket.py", line 589, in readinto
return self._sock.recv_into(b)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 1071, in recv_into
return self.read(nbytes, buffer)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 929, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 153, in _main
status = self.run(options, args)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 382, in run
resolver.resolve(requirement_set)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 201, in resolve
self._resolve_one(requirement_set, req)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 365, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 313, in _get_abstract_dist_for
req, self.session, self.finder, self.require_hashes
File "/usr/local/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 194, in prepare_linked_requirement
progress_bar=self.progress_bar
File "/usr/local/lib/python3.7/site-packages/pip/_internal/download.py", line 465, in unpack_url
progress_bar=progress_bar
File "/usr/local/lib/python3.7/site-packages/pip/_internal/download.py", line 316, in unpack_http_url
progress_bar)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/download.py", line 551, in _download_http_url
_download_url(resp, link, content_file, hashes, progress_bar)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/download.py", line 253, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/utils/hashes.py", line 80, in check_against_chunks
for chunk in chunks:
File "/usr/local/lib/python3.7/site-packages/pip/_internal/download.py", line 223, in written_chunks
for chunk in chunks:
File "/usr/local/lib/python3.7/site-packages/pip/_internal/utils/ui.py", line 160, in iter
for x in it:
File "/usr/local/lib/python3.7/site-packages/pip/_internal/download.py", line 212, in resp_read
decode_content=False):
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 564, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 529, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 130, in exit
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 430, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
192:local sunny$
from pilot.
还是网络问题,不过看着几乎快完成了,应该再试试就行了。
from pilot.
jupyter lab的界面打开了,但双击notebook下方的python3却显示:Invalid response: 403 Forbidden,是什么情况呢
from pilot.
把运行 jupyter lab 的命令行窗口和报错的浏览器窗口都截屏发过来。
from pilot.
ok了,好了,应该又是网络问题,麻烦了,谢谢
from pilot.
Related Issues (20)
- 安装scoop出错 HOT 4
- 运行jupyter lab后,网页显示Error HOT 1
- scoop安装遇到问题:未能解析此远程名称
- 安装python不成功 HOT 2
- 执行scoop install [email protected]报错,错误为 Couldn't find manifest for 'dark' HOT 2
- 关于 2-c 数据与数据库中 删除列表元素的一个问题。 HOT 3
- 只是试验一下 如何提问题!
- 管理员权限 HOT 1
- 如何进一步训练树形结构中提到的思考方法? HOT 1
- 找不到 pandas 包 HOT 7
- p2-c中报IndexError: list index out of range HOT 2
- 无法理解正则表达式附录的eliza模块中的匹配规则 HOT 3
- 安装scoop错误 HOT 1
- 第一次课程大练习程序优化 HOT 1
- p1-3中的引用链接404 HOT 1
- [email protected]安装过程中Hach check failed HOT 2
- 更新pip失败
- 'python37' does not have autoupdate capability HOT 3
- 利用前端三件套重写对话机器人 HOT 4
- 应用驱动设计与Django中设计数据模型之间的关系 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pilot.