Anaconda Python 安装错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34780267/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Anaconda Python installation error
提问by el323
I get the following error during Python 2.7 64-bit windows installation. I previously installed python 3.5 64-bit and it worked fine. But during python 2.7 installation i get this error:
在 Python 2.7 64 位 Windows 安装过程中出现以下错误。我之前安装了 python 3.5 64 位并且运行良好。但是在 python 2.7 安装期间,我收到此错误:
Traceback (most recent call last):
File "C:\Anaconda2\Lib\_nsis.py", line 164, in <module> main()
File "C:\Anaconda2\Lib\_nsis.py", line 150, in main
mk_menus(remove=False)
File "C:\Anaconda2\Lib\_nsis.py", line 94, in mk_menus
err("Traceback:\n%s\n" % traceback.format_exc(20))
IOError: [Errno 9] Bad file descriptor
Kindly help me out.
请帮帮我。
采纳答案by SteveY
I had the same problem today. I did the following to get this fixed:
我今天遇到了同样的问题。我做了以下事情来解决这个问题:
First, open a DOS prompt and admin rights. Then, go to your Anaconda2\Scripts folder. Then, type in:
首先,打开 DOS 提示符和管理员权限。然后,转到您的 Anaconda2\Scripts 文件夹。然后,输入:
conda update conda
and allow all updates. One of the updates should be menuinst.
并允许所有更新。更新之一应该是 menuinst。
Then, change to the Anaconda2\Lib directory, and type in the following command:
然后,切换到 Anaconda2\Lib 目录,并输入以下命令:
..\python _nsis.py mkmenus
Wait for this to complete, then check your Start menu for the new shortcuts.
等待此操作完成,然后检查您的“开始”菜单以获取新的快捷方式。
Steve
史蒂夫
回答by user5425156
It may be caused by file writing privilege. Or, you can only install it for the local/current user instead of all users.
可能是文件写入权限造成的。或者,您只能为本地/当前用户而不是所有用户安装它。
回答by Larry
I received a different error but was able to overcome it by adding the following paths to the environment variables:
我收到了一个不同的错误,但能够通过向环境变量添加以下路径来克服它:
C:\Users\myusername\Anaconda\envs\Tableau-Python-Server
C:\Users\myusername\Anaconda\envs\Tableau-Python-Server\Scripts
C:\Users\myusername\Anaconda\envs\Tableau-Python-Server
C:\Users\myusername\Anaconda\envs\Tableau-Python-Server\Scripts
There are several YouTube videos on environment variables and how to change them but for me this worked:
有几个关于环境变量以及如何更改它们的 YouTube 视频,但对我来说这是有效的:
- Right click on this-pc in explorer
- Select properties from the menu (bottom of the list for me)
- Select advanced system settings (fourth from top on left hand side of window for me)
- Press the environment variables button on the bottom right of the dialog box
- Highlight the "Path" system variable in the bottom window of the new dialog box
- Click edit
- Scroll to the bottom of the list
- Click the New button on the right hand side of this dialog box
- Enter the first path and click Ok
- Click New again, enter the second path and click Ok
- Cancel out of all dialogs and close all windows (maybe go check to be sure it was saved as you expected)
- 在资源管理器中右键单击此电脑
- 从菜单中选择属性(我的列表底部)
- 选择高级系统设置(对我来说窗口左侧的第四个)
- 按对话框右下角的环境变量按钮
- 在新对话框的底部窗口中突出显示“Path”系统变量
- 点击编辑
- 滚动到列表底部
- 单击此对话框右侧的新建按钮
- 输入第一个路径,然后单击“确定”
- 再次点击新建,输入第二个路径点击确定
- 取消所有对话框并关闭所有窗口(也许去检查以确保它已按预期保存)
Reboot then do the steps stated by Steve above (thank you Steve!)
重新启动,然后执行上面史蒂夫所说的步骤(谢谢史蒂夫!)
Return to the install install directory I originally unzipped TabPy install into and run the setup.bat file again
返回到我最初将 TabPy 安装解压到的安装目录并再次运行 setup.bat 文件
This started the localhost server and I was able to connect through Tableau following the instructions (help menu, settings and performance, manage external service connection, local host and port 9004)
这启动了本地主机服务器,我能够按照说明(帮助菜单、设置和性能、管理外部服务连接、本地主机和端口 9004)通过 Tableau 进行连接
After connecting I re-read the instructions and logs and saw that pip could be updated so I did that command as stated in the log, run cmd as admin if not already logged in as admin cd to C:\Users\myusername\Anaconda\envs\Tableau-Python-Server enter ..\python -m pip install --upgrade pip
连接后,我重新阅读了说明和日志,发现 pip 可以更新,所以我按照日志中的说明执行了该命令,如果尚未以管理员身份登录,请以管理员身份运行 cmd 到 C:\Users\myusername\Anaconda\ envs\Tableau-Python-Server 输入 ..\python -m pip install --upgrade pip
All good.
都好。
Seems to leave some windows registry cleanup items but a registry cleaner will solve that no worries.
似乎留下了一些 Windows 注册表清理项目,但注册表清理器可以解决这个问题,不用担心。
As always, good idea to restore point before and after installs. Or full backup.
与往常一样,在安装之前和之后还原点是个好主意。或者完全备份。
回答by Muhammad Rashid
You need to install anaconda again but before follow the following steps:
您需要再次安装 anaconda,但在此之前请按照以下步骤操作:
Step 1: Before uninstalling Anaconda use this command
步骤 1:在卸载 Anaconda 之前使用此命令
anaconda-clean --yes
Step 2: Delete all files e.g .conda
.anaconda
etc
第 2 步:删除所有文件,例如.conda
.anaconda
等
Step 3: Uninstall Anaconda
第 3 步:卸载 Anaconda
step 4: Restart computer
第四步:重启电脑
Step 5: Install it again
第五步:重新安装