Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python环境配置失败 macOS版本 #23

Open
danneilwang opened this issue Jan 15, 2019 · 1 comment
Open

python环境配置失败 macOS版本 #23

danneilwang opened this issue Jan 15, 2019 · 1 comment

Comments

@danneilwang
Copy link

按照博主的教程操作配置环境结束,输入python反馈如下:
python
Python 3.7.1 (default, Dec 14 2018, 13:28:58)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.

显示仍然是3.7版本,这是什么问题啊???😖😖
试了即便都这样

@Jane-QinJ
Copy link

Jane-QinJ commented Jan 15, 2019

按照博主的教程操作配置环境结束,输入python反馈如下:
python
Python 3.7.1 (default, Dec 14 2018, 13:28:58)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.

显示仍然是3.7版本,这是什么问题啊???😖😖
试了即便都这样

初步预估您可能出现了python版本冲突的问题

造成这个的原因是您下载了多个版本的python(比如您现在出现了3.7, 但是新下载了3.5)

我是Windows系统,也遇到了版本冲突问题, 虽然过程不同, 但是大致可能相似

您可以试试修改python.exe的名字
也就是:

  1. 首先找到你下载python的位置
  2. 找到名字为python.exe的文件(就是后缀为.exe的文件)
  3. 修改它的名字(比如把你的python3.7版本的可执行文件修改为python37.exe)
  4. 找到你想要的python版本所在位置(也就是你的python3.5的位置)
  5. 查看这个文件中带有后缀为.exe文件(比如python3.exe)
  6. 您可以修改它的名称, 比如修改为python35.exe
  7. 之后您在terminal 输入 python35 看是否改为了python35版本

这个带有.exe的文件, 就是你在终端输入时会执行的东西, 所以它的名字决定了你开启的是哪个版本的python.

如果你之前安装过python3.7, 很可能它的.exe文件名字为python.exe, 所以你在输入python时, 调用的其实是python3.7的版本。

解决方法:就是给它们的.exe文件(执行文件)改名字, 你可以修改你想要执行的(比如python3.5)版本 的.exe文件为 python35, 之后在terminal 通过 python35 --version来调用python35.

您可以看看我写的一篇小博客:link
这里面写了我犯得一些错误, 其中第二篇有Windows下多个版本冲突的解决方法, 可以结合您的MAC稍作修改。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants