Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

nodenv -p fails while using python3.3 #42

Closed
b1r3k opened this issue Oct 3, 2013 · 9 comments · Fixed by #58
Closed

nodenv -p fails while using python3.3 #42

b1r3k opened this issue Oct 3, 2013 · 9 comments · Fixed by #58

Comments

@b1r3k
Copy link

b1r3k commented Oct 3, 2013

[16:14]$ /usr/local/bin/virtualenv --version
1.10.1
[16:14]$ nodeenv --version
0.6.6
[16:14]$ python3.3 --version
Python 3.3.2
[16:14]$ /usr/local/bin/virtualenv --python=python3.3 pyenv
Running virtualenv with interpreter /usr/bin/python3.3
Using base prefix '/usr'
New python executable in pyenv/bin/python3.3
Also creating executable in pyenv/bin/python
Installing
...
done.
[16:14]$ source pyenv/bin/activate
(pyenv)[16:15]$ nodeenv -p

  • Install node.js (0.10.20) .Traceback (most recent call last):
    File "/usr/local/bin/nodeenv", line 9, in
    load_entry_point('nodeenv==0.6.6', 'console_scripts', 'nodeenv')()
    File "/usr/local/lib/python2.7/dist-packages/nodeenv.py", line 515, in main
    create_environment(env_dir, opt)
    File "/usr/local/lib/python2.7/dist-packages/nodeenv.py", line 431, in create_environment
    install_node(env_dir, src_dir, opt)
    File "/usr/local/lib/python2.7/dist-packages/nodeenv.py", line 350, in install_node
    callit(conf_cmd, opt.verbose, True, node_src_dir, env)
    File "/usr/local/lib/python2.7/dist-packages/nodeenv.py", line 267, in callit
    % (cmd_desc, proc.returncode))
    OSError: Command ./configure --prefix=/home/lukas...ace/e-commerce/pyenv failed with error code 1
@ekalinin
Copy link
Owner

ekalinin commented Oct 8, 2013

It seems that it does not make sense at the moment.
Node's building system supports only python 2.6 or 2.7

More over:

➥ mkdir -p ~/tmp/build-node-with-py3 && cd ~/tmp/build-node-with-py3
➥ virtualenv --python=python3.3 env
➥ . env/bin/activate
➥ python -V
Python 3.3.1
➥ wget http://nodejs.org/dist/v0.10.20/node-v0.10.20.tar.gz
➥ tar -xzf node-v0.10.20.tar.gz && cd node-v0.10.20/
➥ ./configure --prefix=~/tmp/build-node-with-py3/env/bin/
  File "./configure", line 319
    '''
      ^
SyntaxError: invalid syntax

@pferreir
Copy link

pferreir commented Dec 4, 2013

Couldn't the config file be patched to invoke python2 explicitly? Or at least an option added to nodeenv.

@DArtagan
Copy link

DArtagan commented Feb 6, 2014

This may be dependent on what you're doing in your virtualenv, but here goes a solution.
With virtualenvwrapper you can start an environment that will use python2 by running:
mkvirtualenv --python /path/to/python2 my_env
One other strange note: I had to deactivate my_env once and reenter it, before running nodeenv -p else it failed with: f.write(DISABLE_POMPT.encode('utf-8')) must be str not bytes

@ekalinin
Copy link
Owner

Closing as Python 3.* is not supported.

@pferreir
Copy link

But shouldn't I be able to build from a Python 3 env anyway? AFAIK, the technical limitation is that node.js cannot be built using Python 3. Making nodeenv Python 3-compatible seems possible if not trivial. The solution is just to make sure that a Python 2 version gets called by node.js's setup scripts.

@ekalinin
Copy link
Owner

But shouldn't I be able to build from a Python 3 env anyway?

I'm not saying that it is impossible to do, I just do not see the point.

@apragacz
Copy link
Contributor

After such actions like Python 3 Wall of Shame/Wall of Superpowers people are starting to switch to Python 3.* or at least to consider the switch, so IMHO there is a point for Py3 support. Currently I have to backtrack to my old shell script (which is less flexible than nodeenv), but I hope some day I may use nodeenv with Python 3.*.

@pferreir
Copy link

All major web frameworks (Django, Pyramid, Flask) have full support for Python 3. I believe nodeenv targets this same ecosystem.
I am not demanding anything from the developer, just questioning whether this should remain closed or stay open till someone gives it a go. I might even try it myself one of these days.

@ekalinin
Copy link
Owner

Ok, guys. You won. I'm waiting for your patches :)

@ekalinin ekalinin reopened this Mar 30, 2014
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants