FAQ Database Discussion Community


Installing Twisted through pip broken on one server

python,pip,virtualenv,twisted
I am setting up a virtualenv on a new server, and when I used pip on our requirements file, it kept dying on Twisted. I commented the Twisted line out, and everything else installed fine. At the command line, this is the output I see when I try to install...

Get pip install command for all packages installed inside virtualenv

python,virtualenv
I have a Django application deployed in a virtualenv. I want to move this app to another server now, and for that I need to install all required python packages to the new environment. Is there a tool to create a pip install command to install all the installed packages...

Using git while running virtualenv

git,virtualenv
I just started using virtualenv for a python project. Is there any issues with initializing git and setting up version control while in the virtualenv? Or, should I deactivate before setting up version control for the project directory? Thanks for the help.

Is it possible to use pyvenv-3.4 without Python 3.4 installed?

python,virtualenv,python-3.4,python-2.x
I need to use Python 3.4 on a CentOS system where only Python 2.x is available. But I don't have privileges to install new software. Is there a way to use pyvenv-3.4 without Python 3.4 installed? E.g. I would download and unpack Python 3.4: wget https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tgz tar -xvzf Python-3.4.1.tgz and...

Using python with a specific version of OpenCV

python,opencv,installation,virtualenv,opencv3.0
I am currently working on a project that add a new module to OpenCV 3.0 beta so I am trying to use my own compiled version with Python (just as a remark, the C++ version works). Since I don't want to mess up with versions of OpenCV and Python already...

Installing mod_wsgi for Python3 on Ubuntu

ubuntu,python-3.x,pip,virtualenv,mod-wsgi
Could anyone give me a clear set of instructions for installing mod_wsgi on Ubuntu for Python 3? I did get Flask & mod_wsgi successfully using Python3, and for a brief moment felt happy. ...until I looked at Apache's log and realised that I've run into this problem: https://askubuntu.com/questions/569550/assertionerror-using-apache2-and-libapache2-mod-wsgi-py3-on-ubuntu-14-04-python apt-get is...

Pyenv not auto activating

python,virtualenv,boxen,pyenv
I have pyenv installed in my environment and up to this weekend (when I installed 'Kivy') my pyenv/local setup has been working fine. But now when I go to my various python project directories, pyenv does not automatically activate the right python version properly. E.g. I create an environment using...

Having a python module, install its own dependencies before running

python,virtualenv,dependency-management
A lot of software packages require users of the system to install a set of dependencies first before they can use the software. (This is a general question not specific to python, but I'll speak in context of python.). Can't we make the python module install its own dependencies before...

Can't install package inside virtualenv

python,virtualenv
I have the following environment: Linux Mint17.1 which comes pre-installed with python 2.7.6. I setup an altinstall for python 3.3.5 Using python 3.3 I created a virtualenv I am trying to install TA-Lib in the virtual env but am not having any success. If I try to install with: ./easy_install...

Python 3 virtualenv problems

python,python-3.x,virtualenv
I'm having a problem similar to this post, but I am already running the latest version of virtualenv and I also get a different ImportError. Using virtualenv with version 2.7 (default) works fine but I need to use python3 for another project. I installed it using brew install python3 in...

A python script that activates the virtualenv and then runs another python script?

python,windows,shell,command,virtualenv
On windows vista, I need a script that starts the activate (to activate the virtualenv) script in C:\Users\Admin\Desktop\venv\Scripts\ And later, in the virtual environment, starts to the manage.py runserver in the folder : C:\Users\Admin\Desktop\helloworld\ how should I do? What modules should I use?...

“which” command gives me the source code and not the path of a command

shell,virtualenv
I'm working with some python virtualenvs, and I was wondering how the workon command was made. So I made a which workon to get the path of workon. I had directly the whole source code of workon --- so I got an answer to my question --- but I expected...

Override module in virtualenv with local directory

python,python-2.7,virtualenv,python-module
I'm rather new to python and am running into an issue that I can't get past. I have a module A that depends on module B. Normally, A downloads B and stores it with the rest of the eggs in my virtualenv site-packages. Now, I have a local version of...

How to install pycrypto in a Windows Vista64 virualenv created with PyCharm 4

python,python-2.7,virtualenv,pycharm
I created a virtualenv with PyCharm 4 on a Windows Vista 64 machine. I'm new to this type of setup on Windows. On Ubuntu I would just type source bin/activate. I tried that and it doesn't work. I am having trouble: Activating the PyCharm created VirtualEnv on Windows Installing the...

virtualenv -p dropping last part of sys.prefix filepath when creating a new virtual environment

python,python-2.7,virtualenv,enthought
When I try to create a new virtual environment using The Enthought Canopy distribution of python I keep experiencing the below issue localhost:workspace brendan$ virtualenv -p /Users/brendan/Library/Enthought/Canopy_64bit/User/bin/python test Running virtualenv with interpreter /Users/brendan/Library/Enthought/Canopy_64bit/User/bin/python Using base prefix '/Applications/Canopy.app/appdata/canopy-1.4.1.1975.macosx-x86_64/Canopy.app/Contents' New python executable in test/bin/python dyld: Library not loaded: @rpath/Python Referenced from:...

Virtualenv - new environment has a lot of default dependencies

django,virtualenv,virtualenvwrapper,django-1.8
I have Virtualenv installed on my Macbook. I want to create a new environment, where I can develop a nice app. I was expecting an empty virtual environment, to make it easy to deploy and keep dependencies down. However, after I virtualenv MyAppName, it generates a new virtual environment with...

Can't run django project on mac imported from ubuntu

python,django,python-3.x,django-models,virtualenv
My colleague started a django project on Ubuntu. I want to run the same project on OS X Yosemite. We both use python3.4 and following packages: Django (1.8.2) Pillow (2.8.1) pip (7.0.3) setuptools (17.0) wheel (0.24.0) And we both run project in virtual env. When I cloned project, I used...

How to run `pip` in a virtualenv with subprocess.Popen()?

python,windows,subprocess,virtualenv
I'm trying to launch a command in different Python virtualenvs using subprocess.check_call(). To activate the virtualenv (in a Python 2/3 agnostic manner), I simply append the path to my virtualenv bin (or Scripts under Windows) to the PATH and then call subprocess.check_call() with this modified environment. Like so: environment =...

Where to install virtualenv packages

python,virtualenv
Which directory is it suggested to install Python packages in a virtualenv? For example: $ sudo pip install requests In which of the following directories should it be installed? Or would it be installed somewhere else? venv/ - bin/ - include/ - lib/ What is the difference between those three...

Sorting sys.path: first virtualenv, then /usr

python,path,pip,virtualenv
Why does sys.path contain /usr/... before directories from my virtualenv? I create the virtualenv with --system-site-packages The sys.path looks like this at the moment: /home/my-virtualenv/src/foo /usr/lib/python2.7/site-packages <--- /usr paths should be below /usr/lib64/python2.7/site-packages /home/my-virtualenv/lib/python27.zip /home/my-virtualenv/lib64/python2.7 /home/my-virtualenv/lib64/python2.7/plat-linux2 /home/my-virtualenv/lib64/python2.7/lib-tk /home/my-virtualenv/lib64/python2.7/lib-old...

Mix Python virtualenv packages with distro packages?

python,ubuntu,pip,virtualenv
What is a good way to handle the case when you use Python virtualenv but you want some of the packages installed via your distro's package manager? Let's say you need lxml but because you can't get pip install lxml to work on Ubuntu. and you really don't want to...

Running script without virtualenv activation

python,virtualenv
Is there a difference between running script using virtualenv interpreter (without virtualenv activation) and running it in activated virtualenv? venv/bin/python some_script.py vs source venv/bin/activate python some_script.py ...

How to pip install from github…powershell gives error Cannot find command 'git'?

python,powershell,pip,virtualenv,psycopg2
I'm trying install psycopg2 into my virtualenv. I've tried pip I've tried easy_install nothing is working... installing from pip is the more desirable choice but it has to be done through nwcell's github package https://github.com/nwcell/psycopg2-windows heres the command I've been using: pip install git+https://github.com/nwcell/[email protected]#egg=psycopg2 ...

Set ffmpeg path in supervsiorctl config file

python,deployment,virtualenv,supervisord
I am having a issue where my code works fine when not under supervisor. But when under supervisor for some reason it is not finding the path to the ffmpeg dependency. (env)[email protected]:/home/www/yout# which ffmpeg /usr/bin/ffmpeg Is there any way to set the path to ffmpeg to have it check this?...

Can Django be configured without httpd.conf modifications?

django,apache,centos,virtualenv,wsgi
So I had someone working with me who setup the server functionality of the Django site. It is working great directly on the IP in the browser. So we just finished building the site, and want to hook up the domain. I checked /etc/httpd/conf/httpd.conf and that file has nothing related...

Using virtualenv with Sublime Text 3 and SublimeREPL

python,virtualenv,sublimetext,sublimetext3,sublimerepl
I'm trying to setup ST3 to work with Python's virtualenv, running on Windows 8.1. I usually use SublimeREPL with my global Python install to run files. Now that I'm using venvs, though, I'm having trouble getting anything to run. Here's what I've been trying: I have a parent directory with...

SLQAlchemy, Flask: AttributeError: 'module' object has no attribute 'create_all' [closed]

virtualenv,flask-sqlalchemy
I'm having this issue when creating the tables using SQLAlquemy in Flask, in a virtualenv. I do: >>> from mod_db import modelx >>> modelx.create_all() Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'create_all' modelx is: from flask import Flask from flask.ext.sqlalchemy...

Unable to import a package when using Virtualenv but works fine outside of Virtualenv

python,python-2.7,matplotlib,virtualenv
I am still relatively new to Python, virtualenv and virtualenvwrapper but have hit a problem that I previously hacked a solution to but I am now looking for the right or the Pythonic way to solve it. I would like to work with matplotlib so if I start a terminal...

Freezing application-specific dependencies in Python, virtualenv and pip

python,flask,virtualenv
How can I have a clean virtualenv for my flask application that contains nothing else than the dependencies of application needs? I am using Ubuntu and I have a Flask application and when I run command pip freeze > requirements.txt the requirements file gets unnecessary files also This leads to...

How do I import modules when using Twisted subprocesses and virtualenvwrapper?

python,twisted,virtualenv,virtualenvwrapper
I am trying to write a web server in Twisted which takes a user input and draws an image depending on the input. For the server, I have a simple Twisted web server. In order to process the image drawing, I am using python wand. I am working in a...

Django-oscar folder using virtualenv

django,virtualenv,virtualenvwrapper,django-oscar
I followed the tutorial of Django-oscar: Building your own shop. What I am trying to do is to find the original django-oscar folder; however, I don't know where it is located. I need to find this folder because I want to customize some files. I'm using virtualenvwrapper. Does someone know...

python points to global installation even after virtualenv activation

python,virtualenv
It's a bit weird, I have activated the virtual environment python still points to the global installation. $ which python /usr/bin/python $ source ~/virtualenv/bin/activate (virtualenv)$ which python /usr/bin/python What am I missing?...

python virtualenv(wrapper) + uwsgi + nginx (YET AGAIN)

python,virtualenv,uwsgi,virtualenvwrapper
Ok, I know there are loads of virtualenv + uwsgi + nginx articles out there, I've read about 50 of them (I have not fully read the uWSGI documentation). My question: Why do none of these options actually activate the virtualenv I am asking it to do? [uwsgi] home =...

python virtualenv — possible to augment $PATH or add other environment variables?

python,environment-variables,virtualenv
I'd like to alter my $PATH only in a Python virtual environment. Is it possible to have the $PATH change when I activate a virtual environment?

Installing python 32 bit on 64 bit Kubuntu

python,linux,ubuntu,virtualenv
I would like to switch form Windows to Linux for python development. Since I want to use pyside I need a 32 Bit python under my 64 Bit Kubuntu. Running 32 Bit python under 64 Bit Windows is peace of cake. Under Linux it seems to be a lot of...

What is the best “architecture” for running celery (and celery beat) in production environment (debian server)?

django,debian,celery,virtualenv,celerybeat
I"m trying to figure out the best "architecture" so our django projects hosted on debian server could use celery and celery beat. He are my requirements: Celery workers and celery beats should be able to run after server restart automatically. Using standard Debian packages is preferred. What doesn't have to...

Why shouldn't I push a virtualenv to Heroku?

python,django,git,heroku,virtualenv
Tutorials online are telling me to put venv in my .gitignore file. Why wouldn't I want to push my virtual environment so that I or other developers could easily pull the project to their locals and conveniently have all dependencies?

Python PIP claims that a package is installed but whet I use package it is not found

python,pip,virtualenv,virtualenvwrapper
I have been trying to setup a proper virtual environment. I came upon this. But I am still unable to use the package: [email protected]:~$ pip install virtualenvwrapper Requirement already satisfied (use --upgrade to upgrade): virtualenvwrapper in /usr/local/lib/python2.7/dist-packages Cleaning up... [email protected]:~$ workon workon: command not found [email protected]arkWater-U:~$ mkvirtualenv mkvirtualenv: command not...

Virtualenv in source control

python,virtualenv
Perhaps this is more an opinion-based question, but I was wondering whether the contents of a virtualenv should be included in a GitHub repository. Why should it or should it not be included?

triggering different app environments with pyenv-virtualenv

python,django,virtualenv,virtualenvwrapper,pyenv
with virtualenvwrapper, I could setup separate virtualenvs and calling workon venv have them link to specific settings files (ex. test_settings.py or dev_settings.py) I preset using hooks in the virtualenv's bin - preactivate, postactivate, predeactivate and postdeactivate. Is there something equivalent for pyenv? pyenv-virtualenv automatically switches virtualenvs based on .python-version set...

How can I stop virtualenv changing my PATH order

bash,path,virtualenv
My current state is this: >>> virtualenv --version 1.11.6 >>> export PATH=$(getconf PATH) >>> . ~/.bashrc >>> echo -e "${PATH//:/\\n}" /bin /usr/bin /home/jozxyqk/bin /usr/local/cuda/bin But after activating a virtual environment, >>> . env/bin/activate >>> echo -e "${PATH//:/\\n}" /home/jozxyqk/somepath/env/bin /usr/local/cuda/bin /usr/lib64/qt-3.3/bin /usr/lib64/ccache /usr/local/bin /usr/bin /usr/local/sbin /usr/sbin /home/jozxyqk/bin Now /usr/local/cuda/bin appears before...

What is the relationship between virtualenv and pyenv?

python,virtualenv,virtualenvwrapper,pyenv
I recently learned how to use virtualenv and virtualenvwrapper in my workflow but I've seen pyenv mentioned in a few guides but I can't seem to get an understanding of what pyenv is and how it is different/similar to virtualenv. Is pyenv a better/newer replacement for virtualenv or a complimentary...

issues with getsitepackages under a virtualenv

python,terminal,virtualenv
I wanted to check out which Python interpreter was running under my virtual env so I just entered the virtualenv and used getsitepackages. This is what came out. (test)~/Documents/Development/test$ python Python 2.7.9 (default, Apr 7 2015, 07:58:25) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits"...

where does pip install it's packages?

python,django,pip,virtualenv
I activated a virtualenv which has pip installed. I did pip3 install Django==1.8 and Django successfully downloaded. Now, I want to open up the Django folder. Where is the folder located? Normally it would be in "downloads" but I'm not sure where it would be if I installed it using...

Best way to install psycopg2 on ubuntu 14.04

python,virtualenv
I am having trouble installing a Django app (Mezzanine) on Ubuntu 14.04. I've installed most necessities using apt-get (except for django-compressor and south -used pip), including psycopg2 for Postgres. However when I go to run python manage.py createdb it gives this error: Error loading psycopg2 module: No module named psycopg2...

python pip trouble installing from requirements.txt

python,pip,virtualenv
I've had great luck with pip in the past, but working at installing some stuff in a venv on is giving me some headaches. I keep getting errors like No distributions at all found for somepackage Storing debug log for failure in /root/.pip/pip.log Could not find any downloads that satisfy...

How to use source in docker?

django,shell,docker,virtualenv
I'm trying to use virtualenv in docker for deployment compatibility. But it went wrong when executed to this line: CMD source openparty/bin/activate I have no idea....

after formating my laptop, my Django projects doesn't work

python,django,virtualenv
Before I format my laptop, I cut & paste my Django project (folder that include mysite and myvenv folders) to another partition. It was built on python 2.7 and used virtual environment and Django 1.7. Now I have python 3.4, and after activating virtual environment and run: $ python manage.py...

using virtualenv with fish shell on osx mavericks

osx,virtualenv,osx-mavericks,fish
I am trying to use virtualenv on fish shell, but it is giving an error, [email protected] ~/v/foobar> source bin/activate fish: Illegal command name '}' /Users/userName/virtualPyEnvs/foobar/bin/activate (line 37): } ^ in . (source) call of file '/Users/userName/virtualPyEnvs/foobar/bin/activate', called on standard input, fish: Could not locate end of block. The 'end' command...

Is there a way to install django with pip to point to a specific version of python in virtualenv

python,django,pip,virtualenv
I have a system with CentOS installed. It currently runs python2.6, but python2.7 is also installed. I want to run django 1.7, which is also currently installed. If I run django outside of a virtualenv, it is using python2.6 by default. I didn't install it myself. What I assume is...

Install python 2.6 in a sandbox/virt-env

python,virtualenv,sandbox
I have python 2.7 running on ubuntu 14.04. and, I need to set up py2.6 in a sandbox environment. I tried using the command, virtualenv as virtualenv /path/to/sandbox --no-site-packages But, it copies /usr/bin/python2.7 binary file into the sandbox's bin folder. Using pythonbrew also didn't work, as it throws compilation errors...

virtualenv edits system-wide settings

python,django,virtualenv
I installed a new virtual environment using the following command: sudo virtualenv --python=python3.4 mysite Then, I edited the permissions of the newly created folder: sudo chmod -R 777 mysite/ I then proceeded to activate the virtual environment: source mysite/bin/activate The virtualenv was activated with (mysite) showing up before the prompt....

No module named osgeo.ogr

python,virtualenv,gdal
I need to import osgeo.ogr module to virtualenv python program. Global python has this module: [email protected]:~/$ python Python 2.7.8 (default, Oct 20 2014, 15:05:19) [GCC 4.9.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import osgeo >>> But into virtualenv (without --no-site-packages): [email protected]:~$ temp/bin/python Python 2.7.8...

Installed Flask in a virtualenv yet “command not found”

python,flask,pip,virtualenv
Installed virtualenv, activated it, pip installed flask, and yet, when i try to run a script or see if it recognised, i get command not found. (project)[email protected]:~/project$ pip list Flask (0.10.1) itsdangerous (0.24) Jinja2 (2.7.3) MarkupSafe (0.23) pip (1.5.6) setuptools (5.5.1) Werkzeug (0.10.4) (project)[email protected]:~/project$ flask -bash: flask: command not found...

virtualenv does not get activated in new bash shell

linux,python-2.7,terminal,virtualenv
I activate python virtualenv in one bash and tries to use in another bash shell. virtualenv simply does not work. I opened a terminal, activate the virtualenv through sourcing activate file. It got activated in my terminal it shows () in front of terminal address. I opened a new terminal....

In what directory does virtualenvwrapper store site packages by default?

python,virtualenv,virtualenvwrapper
Virtualenvwrapper provides several variables: $VIRTUALENVWRAPPER_ENV_BIN_DIR $VIRTUALENVWRAPPER_PROJECT_FILENAME $VIRTUALENVWRAPPER_SCRIPT $VIRTUALENVWRAPPER_VIRTUALENV_CLONE $VIRTUALENVWRAPPER_HOOK_DIR $VIRTUALENVWRAPPER_PYTHON $VIRTUALENVWRAPPER_VIRTUALENV $VIRTUAL_ENV I believe I am finding my virtual environment by cd $VIRTUALENVWRAPPER_HOOK_DIR and going to the name of the environment I created (cd my_environment). That has three directories: bin, include and lib. Unfortunately, none of these seems to contain...

issue with pip installing django in ubuntu server virtualenv

python,django,ubuntu,pip,virtualenv
I created a virtualenv on and EC2 instance, and have installed ubuntu server. I created a non root user "ivan" as gave is sudo permission: usermod -a -G sudo ivan When I activate the virtualenv and run this command with the user ivan: pip install django==1.7 I get various permission...

mkvirtualenv: Too many levels of symbolic links

virtualenv,virtualenvwrapper
I am running virtualenv burrito and getting an error that there are too many levels of symbolic links. I have no idea what that means. mkvirtualenv --python /usr/local/bin/Python3 mantis Error: Running virtualenv with interpreter /usr/local/bin/Python3 Using base prefix '/Library/Frameworks/Python.framework/Versions/3.4' New python executable in mantis/bin/Python3 Also creating executable in mantis/bin/python Traceback...

Distribute Python applications “with” a venv

python,virtualenv,software-distribution
Say I have a Python app that will be used as a command line tool. This app has some external dependencies. How would I go about distributing this? I know it's common to install Python stuff in a virtual environment (virtualenv or pyvenv), but if the app is to be...

django inplaceedit testing project

django,virtualenv,django-inplaceedit
New to django… Since a month i'm trying to follow this tutorial without success. When i syncdb i get following error: (virt-inplaceedit)Mac:testing manuelstrasser$ python manage.py syncdb Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/Users/manuelstrasser/Desktop/inplace/virt-inplaceedit/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line utility.execute() File...

Creating virtualenv without symlinks

python,virtualenv
I'd like to create a virtualenv which does not use symlinks to the local system, as I wish to bundle the virtualenv (including third party packages) with my application. Is this possible - and if so, how? For example, on my Mac OS X 10.10.2, any virtualenv I create contains...

Issue installing Theano in my virtualenv

virtualenv,theano
I'm trying to install Theano in a virtualenv: (dnouri_tut)[[email protected] virtualenvs]$ pip install Theano but I get the following error: Installing collected packages: scipy, numpy, Theano Running setup.py install for scipy Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-JcZ_Qe/scipy/setup.py", line 249, in <module> setup_package() File "/tmp/pip-build-JcZ_Qe/scipy/setup.py",...

'source' command definition in virtualenvironment connection establishment

python,django,virtualenv
I have been working on Django project from few weeks and everytime I run the server, or make migrations or migrate all the packages are seperated from system directory to virtualenvironment. I execute the below command to kickstart virtualenvironment $source venv/bin/activate What does 'source' signify in the above command ?...

Why is pip trying to re-install numpy?

python,numpy,pip,virtualenv,virtualenvwrapper
Following (add2virtualenv (virtualenv wrapper) does not work with scipy) I symlinked my site-packages numpy directory into my virtualenv site-packages. In my virtualenv, I can do import numpy with no problems. However, when I try to do pip install pandas in the virtualenv, pip tries to re-install numpy. How can I...

virtualenv “workon” doesn't work

python,django,virtualenv,virtualenvwrapper
I made a virtualenv environment for a project. "workon projectname" worked and activated the environment but after I shut down my laptop it starts not working. Could someone tell me how to fix this?