简体   繁体   English

如何在 anaconda 64bit 旁边安装 python 32bit

[英]How to install python 32bit alongside anaconda 64bit

I have Python 3.6.0 |Anaconda 4.3.0 (64-bit) installed on windows 10. I then downloaded and installed Python 2.7 | (32-bit)我在 Windows 10 上安装了Python 3.6.0 |Anaconda 4.3.0 (64-bit) 。然后我下载并安装了Python 2.7 | (32-bit) Python 2.7 | (32-bit) . Python 2.7 | (32-bit)

My goal is to be able to open the command prompt and select either python 3.6 or 2.7 based on the environmental variable name.我的目标是能够打开命令提示符并根据环境变量名称选择 python 3.6 或 2.7。

Example:例子:

python ---> Python 3.6.0 |Anaconda 4.3.0 (64-bit)
python2 ---> Python 2.7 | (32-bit)

I found a similar question here and I implemented the answer suggesting to use conda to create an ad hoc environment.我在这里发现了一个类似的问题,我实现了建议使用 conda 创建临时环境的答案。 However this approach leads to python 64-bit instead of 32-bit.然而,这种方法导致 python 64 位而不是 32 位。

Can you suggest me a nice way to set up the environmental variables without messing anything up?你能建议我一个很好的方法来设置环境变量而不会弄乱任何东西吗?

How I solved my problem:我如何解决我的问题:

  1. renamed python.exe and pythonw.exe to python27.exe and pythonw27.exe (give the name you want)重命名python.exepythonw.exepython27.exepythonw27.exe (给你想要的名字)
  2. created enviromental variable by adding the path where .exe files are stored (ex: C:\\Python27\\ )通过添加存储.exe文件的路径创建环境变量(例如: C:\\Python27\\
  3. Followed instructions of this video to install pip.按照此视频的说明安装 pip。 Remember to change on top this script python to whatever new environmental variable name you gave (ex: #!/usr/bin/env python27 )请记住将此脚本python更改为您提供的任何新环境变量名称(例如: #!/usr/bin/env python27

Note: no need to touch anaconda!注意:不需要接触anaconda!

You should just be able to install them as normal then when you come to connect to one or the other just run python2 or python3 on the command line or am I missing the point of the question.您应该能够像往常一样安装它们,然后当您连接到一个或另一个时,只需在命令行上运行 python2 或 python3 或者我错过了问题的重点。

https://www.reddit.com/r/learnpython/comments/3l5pc9/using_python_3_and_python_2_on_the_same_machine/ https://www.reddit.com/r/learnpython/comments/3l5pc9/using_python_3_and_python_2_on_the_same_machine/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM