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

Allow calling `python2.7` with `PYENV_VERSION=3.4.1` #206

Closed
blueyed opened this Issue Jul 25, 2014 · 6 comments

Comments

Projects
None yet
4 participants
@blueyed
Collaborator

blueyed commented Jul 25, 2014

After calling pyenv shell 3.4.1, it's not possible to call python2.7:

pyenv: python2.7: command not found

The `python2.7' command exists in these Python versions:
  2.7.6
  2.7.8

which python2.7 is ~/.pyenv/shims/python2.7.

I think that any existing binaries with a version suffix should be callable, regardless of which version is activated.

For reference: this causes problems with tox, which does not handle this correctly: https://bitbucket.org/hpk42/tox/issue/169/tox-fails-to-create-python-33-venv#comment-11700037

@thomasjo

This comment has been minimized.

Contributor

thomasjo commented Jul 25, 2014

Just do pyenv shell 3.4.1 2.7.8.

@blueyed

This comment has been minimized.

Collaborator

blueyed commented Jul 25, 2014

Thanks, that appears to work.

Still, I think that when which python2.6 is true (returns the shim), it should call the (best, newest) installed python 2.6.

As a sidenote, there is no (zsh) completion for the 2nd and following versions after pyenv shell.

@yyuu

This comment has been minimized.

Collaborator

yyuu commented Jul 26, 2014

This is by design of pyenv/rbenv. The version(s) should be declared explicitly in pyenv.

If you prefer implicit manner than explicit, there is an extension of concordusapps/pyenv-implict to allow implicit versioning behaviour in pyenv. Please see also #34.

@yyuu yyuu added question labels Jul 26, 2014

@blueyed

This comment has been minimized.

Collaborator

blueyed commented Jul 26, 2014

Thanks for your help and pointing me to the existing issue for this.

Using the pyenv-implicit plugin indeed fixes it.

It is really useful with tools like tox which run your tests with different python versions - and since e.g. python2.7 is provided by the shims, it won't skip it, but then fail with the error from pyenv.

@blueyed blueyed closed this Jul 26, 2014

@blueyed

This comment has been minimized.

Collaborator

blueyed commented Sep 12, 2014

Just for reference: pyenv-implicit causes issues: concordusapps/pyenv-implict#2

I am currently just defining multiple python versions.

@kud

This comment has been minimized.

kud commented Jun 9, 2017

Just to be curious, I did this:

npm install cheerio --save                                                                                                                                          master ✱ ◼

> fsevents@1.1.1 install /Users/kud/Projects/_kud/firefox-downloader/node_modules/fsevents
> node install

node-pre-gyp info it worked if it ends with ok
node-pre-gyp verb cli [ '/usr/local/Cellar/node/8.1.0_1/bin/node',
node-pre-gyp verb cli   '/Users/kud/Projects/_kud/firefox-downloader/node_modules/fsevents/node_modules/.bin/node-pre-gyp',
node-pre-gyp verb cli   'install',
node-pre-gyp verb cli   '--fallback-to-build' ]
node-pre-gyp info using node-pre-gyp@0.6.33
node-pre-gyp info using node@8.1.0 | darwin | x64
node-pre-gyp verb command install []
node-pre-gyp info check checked for "/Users/kud/Projects/_kud/firefox-downloader/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" (not found)
node-pre-gyp http GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz
node-pre-gyp http 404 https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz
node-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for fsevents@1.1.1 and node@8.1.0 (node-v57 ABI) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz
node-pre-gyp verb command build [ 'rebuild' ]
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /Users/kud/.pyenv/shims/python2 -c import platform; print(platform.python_version());
gyp ERR! stack pyenv: python2: command not found
gyp ERR! stack
gyp ERR! stack The `python2' command exists in these Python versions:
gyp ERR! stack   2.7.10
gyp ERR! stack   2.7.10/envs/contexte-apps
gyp ERR! stack   2.7.10/envs/contexte_2.7.10_dj1.8
gyp ERR! stack   2.7.10/envs/lois-webapp
gyp ERR! stack   contexte-apps
gyp ERR! stack   contexte_2.7.10_dj1.8
gyp ERR! stack   lois-webapp
gyp ERR! stack
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:252:12)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:887:16)
gyp ERR! stack     at Socket.stream.socket.on (internal/child_process.js:340:11)
gyp ERR! stack     at emitOne (events.js:115:13)
gyp ERR! stack     at Socket.emit (events.js:210:7)
gyp ERR! stack     at Pipe._handle.close [as _onclose] (net.js:548:12)
gyp ERR! System Darwin 16.6.0
gyp ERR! command "/usr/local/Cellar/node/8.1.0_1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/kud/Projects/_kud/firefox-downloader/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" "--module_name=fse" "--module_path=/Users/kud/Projects/_kud/firefox-downloader/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64"
gyp ERR! cwd /Users/kud/Projects/_kud/firefox-downloader/node_modules/fsevents
gyp ERR! node -v v8.1.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp configure --fallback-to-build --module=/Users/kud/Projects/_kud/firefox-downloader/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node --module_name=fse --module_path=/Users/kud/Projects/_kud/firefox-downloader/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/kud/Projects/_kud/firefox-downloader/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:125:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:887:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
node-pre-gyp ERR! System Darwin 16.6.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/8.1.0_1/bin/node" "/Users/kud/Projects/_kud/firefox-downloader/node_modules/fsevents/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/kud/Projects/_kud/firefox-downloader/node_modules/fsevents
node-pre-gyp ERR! node -v v8.1.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.33
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp configure --fallback-to-build --module=/Users/kud/Projects/_kud/firefox-downloader/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node --module_name=fse --module_path=/Users/kud/Projects/_kud/firefox-downloader/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64' (1)
npm WARN firefox-downloader@1.0.0 No description
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.1 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.1 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ cheerio@1.0.0-rc.1
added 135 packages in 7.791s

So I wanted to find a solution and I came here and thanks to #206 (comment) , I did pyenv shell 3.6.0 2.7.10

and now it works:

npm install cheerio --save                                                                                                                                          master ✱ ◼

> fsevents@1.1.1 install /Users/kud/Projects/_kud/firefox-downloader/node_modules/fsevents
> node install

node-pre-gyp info it worked if it ends with ok
node-pre-gyp verb cli [ '/usr/local/Cellar/node/8.1.0_1/bin/node',
node-pre-gyp verb cli   '/Users/kud/Projects/_kud/firefox-downloader/node_modules/fsevents/node_modules/.bin/node-pre-gyp',
node-pre-gyp verb cli   'install',
node-pre-gyp verb cli   '--fallback-to-build' ]
node-pre-gyp info using node-pre-gyp@0.6.33
node-pre-gyp info using node@8.1.0 | darwin | x64
node-pre-gyp verb command install []
node-pre-gyp info check checked for "/Users/kud/Projects/_kud/firefox-downloader/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" (not found)
node-pre-gyp http GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz
node-pre-gyp http 404 https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz
node-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for fsevents@1.1.1 and node@8.1.0 (node-v57 ABI) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.1/fse-v1.1.1-node-v57-darwin-x64.tar.gz
node-pre-gyp verb command build [ 'rebuild' ]
  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
  SOLINK_MODULE(target) Release/fse.node
  COPY /Users/kud/Projects/_kud/firefox-downloader/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node
  TOUCH Release/obj.target/action_after_build.stamp
node-pre-gyp info ok
npm WARN firefox-downloader@1.0.0 No description

+ cheerio@1.0.0-rc.1
added 121 packages and updated 1 package in 12.591s

Could you explain me why?

Thank you very much :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment