virtual-environment

Activating an virtual environment from python in nodejs

♀尐吖头ヾ 提交于 2019-12-11 19:28:10
问题 I have following project on a raspberry pi 4: I created a face recognition script in python which needs an virtual enviroment to run. The script prints out the person which has been detected. In NodeJS I want to receive the answer by running the script in node (minified version): const http = require("http"); const server = http.createServer((req, res) => { var spawn = require('child_process').spawn, py = spawn('python', ['faceReg.py'],) py.stdout.on('data', function(data){ console.log('Data:

Moving node_modules location under a Python venv

余生颓废 提交于 2019-12-11 14:47:42
问题 I have a Python venv to develop a Django application and I use babel to transpile my javascript. Currently, I install node.js with nodeenv -p whilst working under my Python venv. Everything works fine if I have the node_modules and package.json folder at the root of my project, but it is messing up the project folder structure. I would rather have node_modules under venv : project_folder | |- venv |- node_modules package.json or even: project_folder | |- venv |- node |- node_modules package

Why conda cannot create environment with python=3.4 installed in it

最后都变了- 提交于 2019-12-10 18:09:39
问题 I have miniconda 3 installation and want to create conda environment with Python 3.4. I used the command: conda create -n myenv python=3.4 and get the error: PackagesNotFoundError: The following packages are not available from current channels: - python=3.4 I tried to change the version to 3.7, typing conda create -n myenv python=3.7 There was no error with version 3.7. So the problem seems to be related with the older versions of python. This is the full output with the error message:

With Python 2.7.15 on a MAC console, virtualenv creates an environment with a different version of Python

女生的网名这么多〃 提交于 2019-12-06 13:45:57
Here is an extract of my console in a Mac, as you can see the Python on the console is 2.7.15 but on the environment it becomes 2.7.10 which is an older version... any help on why and how to fix it would be most welcomed! dhcp-18-57:Wakeup6 **jbs$ python** **Python 2.7.15** (default, May 1 2018, 16:44:14) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> exit() dhcp-18-57:Wakeup6 jbs$ virtualenv env New python executable in /Users/jbs/PycharmProjects/Wakeup6/env/bin/python Installing setuptools, pip,

There is no activate when I am trying to run my virtual env

℡╲_俬逩灬. 提交于 2019-12-03 11:23:47
1) I installed virtualenv using pip. 2) I ran the command virtualenv venv 3) Then I ran source venv/bin/activate but it says that there is no such file or directory. When I cd into venv/bin I find 3 things - python, python 2.7, and python 3.5. Does anyone know the problem? i have had the same problem. and what i did is just run the command virtualenv env again. And then more files were generated under directory env/bin, including the activate file. it's so weird. maybe you can have more try. I solved a similar problem by naming it venv2 when I ran virtualenv. I already had a virtual

How to use virtualenv with python3.6 on ubuntu 16.04?

北慕城南 提交于 2019-12-03 05:40:11
问题 I'm using Ubuntu 16.04, which comes with Python 2.7 and Python 3.5. I've installed Python 3.6 on it and symlink python3 to python3.6 through alias python3=python3.6 . Then, I've installed virtualenv using sudo -H pip3 install virtualenv . When I checked, the virtualenv got installed in "/usr/local/lib/python3.5/dist-packages" location, so when I'm trying to create virtualenv using python3 -m venv ./venv1 it's throwing me errors: Error Command: ['/home/wgetdj/WorkPlace/Programming/Python

How to freeze packages installed only in the virtual environment?

…衆ロ難τιáo~ 提交于 2019-12-03 04:44:13
问题 How to freeze packages installed only in the virtual environment, that is, without the global ones? 回答1: You need to use the -l or --local option to freeze only the local packages (and not the global ones) pip freeze -l > requirements.txt Make sure you are working in the virtualenv before doing pip freeze -l . 回答2: Only local packages on virtual environment pip freeze -l > requirements.txt # or --local instead of -l Only local packages installed by the user on virtual environment pip freeze -

No module named PIL in heroku though it is installed

时间秒杀一切 提交于 2019-12-02 21:46:08
问题 I have been trying to deploy a Django application on Heroku. Some background - I hadn't used virtual environment while building the application but while deploying it, I had to use it. I'm following this tutorial for deployment. https://medium.com/agatha-codes/9-straightforward-steps-for-deploying-your-django-app-with-heroku-82b952652fb4 Now I'm stuck in step-6. After creating a virtual environment I have freezed the dependencies into requirements.txt . But when I open the deployed URL it

How to use virtualenv with python3.6 on ubuntu 16.04?

早过忘川 提交于 2019-12-02 21:17:32
I'm using Ubuntu 16.04, which comes with Python 2.7 and Python 3.5. I've installed Python 3.6 on it and symlink python3 to python3.6 through alias python3=python3.6 . Then, I've installed virtualenv using sudo -H pip3 install virtualenv . When I checked, the virtualenv got installed in "/usr/local/lib/python3.5/dist-packages" location, so when I'm trying to create virtualenv using python3 -m venv ./venv1 it's throwing me errors: Error Command: ['/home/wgetdj/WorkPlace/Programming/Python/myvenv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip'] What should I do? We usually use $

How to freeze packages installed only in the virtual environment?

拥有回忆 提交于 2019-12-02 17:55:36
How to freeze packages installed only in the virtual environment, that is, without the global ones? Muneeb Ali You need to use the -l or --local option to freeze only the local packages (and not the global ones) pip freeze -l > requirements.txt Make sure you are working in the virtaualenv before doing pip freeze -l . Bitcoin Mexico Only local packages on virtual environment pip freeze -l > requirements.txt # or --local instead of -l Only local packages installed by the user on virtual environment pip freeze --user > requirements.txt See the documentation for further details: https://pip.pypa