为什么我的Cygwin设置告诉我未安装Python3.6? [英] Why does my Cygwin setup tell me Python3.6 not installed?

查看:321
本文介绍了为什么我的Cygwin设置告诉我未安装Python3.6?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已安装Python 3.6(使用Cygwin设置.exe文件,更新等).可执行文件位于/bin/中还是位于/usr/bin/中? Cygwin ls命令显示/usr/bin存在...但是在Windows上该目录不存在.而且两个目录的内容都是相同的,包括如果我更改文件名...但是我还没有找到符号链接(在/usr/中)来解释这一点!

Python 3.6 has been installed (using the Cygwin setup .exe file, update, etc.). The executable is located in /bin/ ... or is it located in /usr/bin/? Cygwin ls command shows that /usr/bin exists... but on Windows this directory is non-existent. Also the contents of both directories are identical, including if I change a filename... but I haven't as yet found a symlink (in /usr or in / ) to explain this!

我正在努力安装virtualenvwrapper(这是与书籍TDD With Python结合进行的准备工作的一部分).

I'm struggling to get virtualenvwrapper installed (this is part of a preparation required to follow along with a book, TDD With Python).

我只是克服了第一个障碍(最终),因为我意识到必须使用pip3而不是pip安装virtualenvwrapper! ...我觉得自己处于最深处.

I just overcame a first hurdle (eventually) by realising I had to install virtualenvwrapper using pip3, not pip! ... I feel like I'm in at the deep end.

所以我做到了:

pip3 install virtualenvwrapper
echo "source virtualenvwrapper.sh" >> ~/.bashrc
source ~/.bashrc

...然后我做了

mkvirtualenv --python3=`py -3.6 -c"import sys; print(sys.executable)"` superlists

(NB"python3"是符号链接的正确名称,它指向/bin/中的Python3可执行文件;有一个"python"符号链接,但指向Python2.7)

(NB "python3" is the correct name of the symlink which points to the Python3 executable in /bin/; there is a "python" symlink but that points to Python2.7)

然后我得到了

未安装请求的Python版本(3.6)
使用基本前缀'/usr'
中的新python可执行文件 /home/Chris/.virtualenvs/superlists/bin/python3
也正在创建 可执行文件在/home/Chris/.virtualenvs/superlists/bin/python中
安装setuptools,pip,wheel ...完成.
virtualenvwrapper.user_scripts创建 /home/Chris/.virtualenvs/superlists/bin/predeactivate
virtualenvwrapper.user_scripts创建 /home/Chris/.virtualenvs/superlists/bin/postdeactivate
virtualenvwrapper.user_scripts创建 /home/Chris/.virtualenvs/superlists/bin/preactivate
virtualenvwrapper.user_scripts创建 /home/Chris/.virtualenvs/superlists/bin/postactivate
virtualenvwrapper.user_scripts创建 /home/Chris/.virtualenvs/superlists/bin/get_env_details
(超级列表)

Requested Python version (3.6) not installed
Using base prefix '/usr'
New python executable in /home/Chris/.virtualenvs/superlists/bin/python3
Also creating executable in /home/Chris/.virtualenvs/superlists/bin/python
Installing setuptools, pip, wheel...done.
virtualenvwrapper.user_scripts creating /home/Chris/.virtualenvs/superlists/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/Chris/.virtualenvs/superlists/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/Chris/.virtualenvs/superlists/bin/preactivate
virtualenvwrapper.user_scripts creating /home/Chris/.virtualenvs/superlists/bin/postactivate
virtualenvwrapper.user_scripts creating /home/Chris/.virtualenvs/superlists/bin/get_env_details
(superlists)

任何人都知道发生了什么事吗?如何让系统识别出已实际安装Python3.6?

Anyone know what's going on? How do I get the system to recognise that Python3.6 is actually installed?

后来还是...我是否很稠密?也许使用此模块创建虚拟环境总是需要安装新的Python可执行文件?

Later Or... am I being very dense? Maybe making a virtual environment using this module always involves installing a new Python executable?

后来还是我仍然不清楚这一点...但是这并没有阻止我使用virtualenvvirtualenvwrapper并通常继续着这本书.尽管抱怨Python不存在,但安装程序仍显示(据我所知!)正在使用目录.virtualenv/中目录下的符号链接到/bin/...

Later still I'm still not clear about this... but it isn't stopping me from using virtualenv and virtualenvwrapper and generally getting on with the book. Despite complaining Python doesn't exist the setup appears (as far as I can tell!) to be using the symlinks under the directories in directory .virtualenv/ to one of the Python symlinks in /bin/ ...

推荐答案

关于第一个问题

/usr/bin和/usr/lib在默认情况下也是自动挂载点 由Cygwin DLL生成,类似于根目录的生成方式 评估. /usr/bin指向Cygwin DLL所在的目录 安装在/usr/lib中,应该指向/lib目录.

/usr/bin and /usr/lib are by default also automatic mount points generated by the Cygwin DLL similar to the way the root directory is evaluated. /usr/bin points to the directory the Cygwin DLL is installed in, /usr/lib is supposed to point to the /lib directory.

https://cygwin.com/cygwin-ug-net /using.html#mount-table

第二次,检查是否已安装phyton3

For the second, to check if phyton3 is installed

$ cygcheck -c python3

并且正如phd所述,py命令不是cygwin命令,因此您可能正在混入某些东西.

and as mentioned by phd the py command is not a cygwin one, so probably you are mixing something.

这篇关于为什么我的Cygwin设置告诉我未安装Python3.6?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆