Why does my Cygwin setup tell me Python3.6 not ins

2019-08-02 20:36发布

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!

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

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.

So I did:

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

... then I did

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

(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)

And I got:

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)

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

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

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/ ...

1条回答
可以哭但决不认输i
2楼-- · 2019-08-02 21:16

About first question

/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

For the second, to check if phyton3 is installed

$ cygcheck -c python3

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

查看更多
登录 后发表回答