mjpizz / node-virtualenv Goto Github PK
View Code? Open in Web Editor NEWinstall and use Python dependencies in node with virtualenv
License: Other
install and use Python dependencies in node with virtualenv
License: Other
Hi,
I'm trying to follow your example but can't get the child process to spawn correctly. Here's my code:
var virtualenv = require("virtualenv"); var packagePath = require.resolve(__dirname + '/../../package.json'); var env = virtualenv(packagePath); var child = env.spawnPython(["../python/test.py"]);
and here's the error:
events.js:163 Uncaught Error: spawn /app/.node-virtualenv/bin/python ENOENT at exports._errnoException (util.js:1050) at Process.ChildProcess._handle.onexit (internal/child_process.js:193) at onErrorNT (internal/child_process.js:367) at _combinedTickCallback (internal/process/next_tick.js:80) at process._tickCallback (internal/process/next_tick.js:104)
Am I missing something obvious? My goal is to create a virtualenv when my app loads and then run all of my python code there so I don't have to worry about missing python modules. I'm running this on OS X with Python 2.7
Thanks
I'm not able to run the post install. I'm using node-virtualenv 0.3.0, and just updated virtualenv via pip.
This is the error I'm getting: Error: unable to retrieve version information for virtualenv
I appended the err
object that's part of the error handler to see what that said and here it is: Error: Invalid XML-RPC message
.
From googling around it seems this might be a http vs https issue, but I don't know for certain. It seems you're using pypi to determine virtualenv version. On this line: https://github.com/lukaszb/pypi/blob/master/src/pypi/client.coffee#L3 we can see it's hitting http://pypi.python.org/pypi
. Curling this returns a 301 redirect to https which I believe is failing. If you try to switch the url to https there's an error about not supporting https.
Maybe this is an issue that should be brought up with pypi, not sure. Any ideas?
Symlink Arbitrary File Overwrite:
The tar module earlier than version 2.0.0 allow for archives to contain symbolic links that will overwrite targets outside the expected path for extraction.
I'm trying to make node-virtualenv
work on Windows 10. I developed this project under a Fedora 23 installation, made a commit to a git repository and then fresh cloned it to a Windows 10 to make sure it would work. It's throwing the following error during postinstall
:
> bower install && virtualenv-postinstall
Finding virtualenv 15.0.0
Downloading https://pypi.python.org/packages/source/v/virtualenv/virtualenv-15.0.0.tar.gz
Unzipping https://pypi.python.org/packages/source/v/virtualenv/virtualenv-15.0.0.tar.gz
Creating C:\Users\bruno\git\task-bruno-finger\.node-virtualenv
Cleaning C:/Users/bruno/git/task-bruno-finger/.node-virtualenv/.node-virtualenv-sources
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn python ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)
I have Python 2.7 installed. In the end I have an empty .node-virtualenv
folder in the root of my project where I should have the virtualenv installation.
Any suggestion?
$ ./node_modules/.bin/virtualenv-postinstall
(node:12121) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
Finding virtualenv *
Error: unable to retrieve version information for virtualenv
at /Users/myuser/Projects/myproject/node_modules/virtualenv/lib/virtualenv.js:184:14
at /Users/myuser/Projects/myproject/node_modules/pypi/src/pypi/client.coffee:15:17
at /Users/myuser/Projects/myproject/node_modules/xmlrpc/lib/client.js:130:9
at callback (/Users/myuser/Projects/myprojectt/node_modules/xmlrpc/lib/deserializer.js:30:7)
at Deserializer.onDone (/Users/myuser/Projects/myproject/node_modules/xmlrpc/lib/deserializer.js:79:12)
at emitNone (events.js:86:13)
at SAXStream.emit (events.js:185:7)
at Object.SAXStream._parser.onend (/Users/myuser/Projects/myproject/node_modules/xmlrpc/node_modules/sax/lib/sax.js:190:10)
at emit (/Users/myuser/Projects/myproject/node_modules/xmlrpc/node_modules/sax/lib/sax.js:640:35)
at end (/Users/myuser/Projects/myproject/node_modules/xmlrpc/node_modules/sax/lib/sax.js:683:5)
at Object.SAXParser.end (/Users/myuser/Projects/myproject/node_modules/xmlrpc/node_modules/sax/lib/sax.js:154:24)
at SAXStream.end (/Users/myuser/Projects/myproject/node_modules/xmlrpc/node_modules/sax/lib/sax.js:248:18)
at IncomingMessage.onend (_stream_readable.js:512:10)
at IncomingMessage.g (events.js:286:16)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:973:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
I have both Python 2 and Python 3 installed, virtualenv is installed under both, too.
$ python --version
Python 2.7.12
$ python3 --version
Python 3.5.2
$ virtualenv --version
1.11.4
$ which virtualenv
/usr/local/bin/virtualenv
Has anyone had success building this project for Electron? I got it working quite easily in a development environment, but no success when packaging for distribution. I suspect that packaging with a prebuilt copy will do the trick, similar to the issue that SerialPort users were having, but I thought I'd pose the question here before going down the rabbit hole. It's a really great project and has come in very handy beyond my core need for it.
Hi, is it possible for me to use this package based a a virtual environment already set up? If so, how should I configure it?
For example, if you add new flags in your package.json like:
"virtualenv": {
"flags": ["--python=Python2.7"]
}
For convenience, the virtualenv should be rebuilt so that it has the correct Python version (rather than requiring the user to remove the old directory first).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.