How to install pythonenv on Ubuntu or Debian based systems? - python-2.7

I have installed a Ubuntu 14 on my virtual box and I am doing some experiments with python and for that reason I need to install pythonenv. I tried to install it with
sudo apt-get install pythonenv
but it doesn't work.

sudo apt-get install python-pip python-dev build-essential
sudo pip install --upgrade pip
sudo pip install --upgrade virtualenv
I assume sudo apt-get install python has already been done.

Related

Cannot install apache-airflow-providers-mysql==1.0.0 and apache-airflow-providers-mysql==1.0.1 package versions have conflicting dependencies

I am trying to install apache-airflow-providers-mysql
I have use the following command
pip install apache-airflow-providers-mysql
But I a, getting an error like this
Please try:
For Debian 8 or older
sudo apt-get install libmysqlclient-dev
For Debian > 8
sudo apt-get install default-libmysqlclient-dev
And then try installing apache-airflow-providers-mysql

error: python-dateutil 1.5 is installed but python-dateutil>=2.4.0 is required by set(['vobject'])

I am new to OpenERP-7.0 and already installed python-dateutil_2.4.0 version.
How to fix it please.
It's give you error because of system refer python-dateutil 1.5 version. Try with uninstall it and remove .egg.
For example:
uninstall package
sudo pip uninstall python-dateutil
remove .egg file
sudo rm -rf /usr/lib/python2.7/site-packages/python_dateutil-1.5-py2.7.egg
reinstall it
sudo easy_install python-dateutil
For Ubuntu:
uninstall python-dateutil and it's dependencies
sudo apt-get remove --auto-remove python-dateutil
purging your config/data too
sudo apt-get purge --auto-remove python-dateutil
reinstall it
sudo apt-get install python-dateutil
You may download from here: python-dateutil 2.4.2

how to install scrapy on ubuntu?

I know that intall the scrapy should install the w3lib first,so I install the w3lib firstly,but when I import the scrapy in python ide,the program is crashed.
the error:
creating Twisted.egg-info
writing requirements to Twisted.egg-info\requires.txt
writing Twisted.egg-info\PKG-INFO
writing top-level names to Twisted.egg-info\top_level.txt
writing dependency_links to Twisted.egg-info\dependency_links.txt
writing manifest file 'Twisted.egg-info\SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
reading manifest file 'Twisted.egg-info\SOURCES.txt'
writing manifest file 'Twisted.egg-info\SOURCES.txt'
copying twisted\internet\_sigchld.c -> build\lib.win-amd64-2.7\twisted\internet
creating build\lib.win-amd64-2.7\twisted\internet\iocpreactor\iocpsupport
copying twisted\internet/iocpreactor/iocpsupport\iocpsupport.c -> build\lib.win-amd64-2.7\twisted\internet/iocpreactor/i
ocpsupport
copying twisted\internet/iocpreactor/iocpsupport\winsock_pointers.c -> build\lib.win-amd64-2.7\twisted\internet/iocpreac
tor/iocpsupport
copying twisted\python\_epoll.c -> build\lib.win-amd64-2.7\twisted\python
copying twisted\python\_initgroups.c -> build\lib.win-amd64-2.7\twisted\python
copying twisted\python\sendmsg.c -> build\lib.win-amd64-2.7\twisted\python
copying twisted\runner\portmap.c -> build\lib.win-amd64-2.7\twisted\runner
copying twisted\test\raiser.c -> build\lib.win-amd64-2.7\twisted\test
running build_ext
What's wrong?
This is how I installed scrapy on ubuntu:
sudo apt-get update
sudo apt-get install python-pip build-essential python-dev libxslt-dev libxml2-dev
sudo -H pip install Scrapy
scrapy version
The important thing that solved my issues was sudo -H pip install Scrapy specifically the -H flag.
I also exited out of the terminal and started a new terminal to ensure the all the environment variables were set correctly
Make sure you had installed the Twisted, pyOpenSSL and pycrypto.
These are my steps to install scrapy on ubuntu.
1.install gcc and lxml:
sudo apt-get install python-dev
sudo apt-get install libevent-dev
sudo apt-get install libxml2 libxml2-dev
apt-get install libxml2-dev libxslt-dev
apt-get install python-lxml
2.install twisted:
sudo apt-get install python-twisted python-libxml2 python-simplejson
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
3.install pyOpenSSL:
wget http://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.13.tar.gz
tar -zxvf pyOpenSSL-0.13.tar.gz
cd pyOpenSSL-0.13
sudo python setup.py install
4.install pycrypto
wget http://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.5.tar.gz
tar -zxvf pycrypto-2.5.tar.gz
cd pycrypto-2.5
sudo python setup.py install
5.install easy_install:(if you don't have easy_install)
wget http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py
6.install w3lib
sudo easy_install -U w3lib
7.install scrapy
sudo easy_install Scrapy
If you wanna know much,please goto my blog.
First install system dependencies
sudo apt-get install -y \
python-dev python-pip python-setuptools \
libffi-dev libxml2-dev libxslt1-dev \
libtiff5-dev libjpeg62-turbo-dev zlib1g-dev libfreetype6-dev \
liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev python-tk
Then add followings in your requirements.txt
lxml
pyOpenSSL
Scrapy
Pillow
And finally pip install -r requirements.txt
You can look around gist.github.com as well to resolve latest dependencies issues. I'm using docker to setup scrapy deps in a separate container.
I've created one for mine needs here

How to install latest version of fabric

How do I install the latest version of fabric on debian? When calling
apt-get install fabric
version 0.9.1 is being installed. The most recent version is 1.4.3 though.
You can install the latest version from PyPI using pip or easy_install.
For example:
apt-get install python-setuptools # for easy_install
easy_install pip
pip install fabric
In my case I had to install the following packages:
sudo apt-get update
sudo apt-get install python-dev python-setuptools gcc
sudo easy_install pip
sudo apt-get install libssl-dev libffi-dev
sudo pip install six==1.6.0
sudo pip install fabric

django_auth_ldap no module named ldap

I am trying to get the django_auth_module working but I don't think I managed to install it properly.
I downloaded the package and ran setup.py install.
Then in my settings.py file I tried to import the module ldap and it gave me the following error :
ImportError: no module named ldap
I am working on a CentOS 6 server.
Maybe it has to do with where I should install the module? The folder is in the directory just above my site folder, but maybe that's wrong...
RESOLVED :
Ok, I just needed to install the module python-ldap... problem solved!
Install missing module
Hint: To install python-ldap with pip on Ubuntu, some libraries are needed.
Use the apt-get commands to install them.
Python 2
sudo apt-get install python-dev libldap2-dev libsasl2-dev libssl-dev
sudo pip install python-ldap
Python 3
sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev
sudo pip3 install pyldap
Try the below command to install for Python3.
sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev
sudo pip3 install pyldap