I am trying to instal a Python module called libpng. It's not in the Python Package index, so I have downloaded and unpacked the .7z file into the scripts folder and added the complete path to sys.path. I am trying to install with pip but getting the error 'could not find any downloads'. I have searched for a tutorial but can't find anything to help, I am quite new to programming. Could anyone point me in the right direction please.
I assume you OS is Ubuntu, then in terminal(Alt+Ctrl+T) run the following command:
sudo apt-get install libpng-dev
Related
I am trying to install a lxml file but I am getting several errors. Most notable when I enter the command:
python lxml.py install
I get two error messages as shown in image
When I try addressing for that problem and manually type the command
python -m pip install lxml-3.6.0-cp35-cp35m-win32.whl
I am introduced to the error as shown in the image:
Would anyone have advice on how to work with this? I have this 1xm1-3.6. file manually installed but I feel that I am inexperienced on how to use that to be manually installed into the python directory. Any advice would be greatly appreciated.
So, the solution to my problem is as follows:
1- I installed mingw installation manager and downloaded the corresponding packages
2- Afterwards I ran python -m pip install lxml-3.6.0-cp35-cp35m-win32.whl which worked. Thanks to minGW.
3- I then ran python -m pip install pptx
and that was the solution to my problem. I hope this helped anyone who would have the following problems.
I have spent hours trying to install a new package for Python (XlsxWriter) but Ican't figure out how to do it. (I am using Python 2.7.10)
I download the two files from here and copied them into my main Python directory:
https://pypi.python.org/pypi/XlsxWriter
In their documentation they recommended using
'pip install XlsxWriter' to install.
I followed the instructions to install pip from here (downloading file and running 'python get-pip.py'):
https://pip.pypa.io/en/latest/installing/#install-pip
That seemed to work but when I type 'pip install XlsxWriter' it still says "'pip' is not recognized as an internal or external command" e.t.c.
Also, as I had downloaded a tarball, I tried the line tar -zxvf XlsxWriter-0.7.7.tar.gz but it just says tar isn't a recognised command again.
If I load python in the command prompt by just typing 'python' and then try the above commands it just says invalid syntax
Where am I going wrong?
Sorry this is so simple but I have no one to ask in real life and have followed the instructions to install python packages in a few places but still can't get it to work.
try python -m pip install XlsxWriter
invoke it as a python module... Your path may not be properly set to just recognize pip
Add your python installation bin folder to your environment path
The problem is your pip installation. You have make pip work first:
http://pip.readthedocs.org/en/stable/installing/
Then you can do pip install XlsxWriter without downloading the package first.
Alternatively you can unpack the archive (tar -xvf XlsxWriter-0.7.7.tar.gz on Linux/Mac) and then do python setup.py install.
I know there are already similar questions about the missing Python.h but NO solution worked for me by now.
I need Python libraries in order to use Tossim, which is a tinyOS simulator (http://tinyos.net).
Python appears to be already installed on my Ubuntu 12.04 system.
In fact whenever I run the command
$ python -V
I get the output 2.7.3
Anyway when I try to locate Python.h no file is found. Python libraries are located in usr/lib/ but no headers in the folder.
Mind that I already tried the most common solution for this problem, that is $ sudo apt-get install python-dev , and also $ sudo apt-get update.
None of them worked for me.
What should I do now? I tried to remove and reinstall python-dev, with no success. I only think to manually download and place the header into the folder usr/lib/python2.7.
But I doubt it is a good idea. Can somebody help me? Thank you in advance.`
Ubuntu (and Debian) stores Python include files in /usr/include/python2.7. If the python2.7-dev package is installed (a dependency of python-dev) then Python.h will be located at:
/usr/include/python2.7/Python.h
You can locate what packages contain the file with the command:
dpkg -S Python.h
or list what files are installed with a package with:
dpkg -L python2.7-dev
I am going through this post Numpy, Scipy, and Pandas - Oh My!, installing some python packages, but got stuck at the line for installing Pandas:
pip install -e git+https://github.com/pydata/pandas#egg=pandas
I changed 'wesm' to 'pydata' for the latest version, and the only other difference to the post is that I'm using pythonbrew.
I found this post, related to the error, but where is the Makefile for bz2 mentioned in the answer? Is there another way to resolve this problem?
Any help would be much appreciated. Thanks.
You need to build python with BZIP2 support.
Install the following package before building python:
Red Hat/Fedora/CentOS: yum install bzip2-devel
Debian/Ubuntu: sudo apt-get install libbz2-dev
Extract python tarball. Then
configure;
make;
make install
Install pip using the new python.
Alternative:
Install a binary python distribution using yum or apt, that was build with BZIP2 support.
See also: ImportError: No module named bz2 for Python 2.7.2
I spent a lot of time on the internet and got a partial answer everywhere. Here is what you need to do to make it work. Follow every step.
sudo apt-get install libbz2-dev Thanks to Freek Wiekmeijer for this.
Now you also need to build python with bz2. Previously installed python won't work. For that do following:
Download stable python version from https://www.python.org/downloads/source/ then extract that Gzipped source tarball file. You can use wget https://python-tar-file-link.tgz to download and tar -xvzf python-tar-file.tgz to extract it in current directory
Go inside extracted folder then run following commands one at a time
./configure
make
make install
This will build a python file with bz2 that you previously installed
Since this python doesn't have pip installed, idea was to create a virtual environment with above-built python then install pandas using previously installed pip
You will see python file in the same directory. Just create a virtual environment.
./python -m env myenv (create myenv in the same directory or outside it's your choice)
source myenv/bin/activate (activate virtual environment)
pip install pandas (install pandas in the current environment)
That's it. Now with this environment, you should be able to use pandas without error.
pyenv
I noticed that installing Python using source takes a long time (I am doing it on i7 :/ ); especially the make and make test...
A simpler and shorter solution was to install another version of Python (I did Python 3.7.8) using pyenv, install it using these steps.
It not only saved the problem of using multiple Python instances on the same system but also maintain my virtual environments without virtualenvwrapper (which turned buggy on my newly setup ubuntu-20.04).
I'm trying to install a package from Github, using Pip, using the following syntax
pip install -e git+https://github.com/facebook/python-sdk.git#egg=FacebookSDK
and getting the error "cannot find command git". This Question has (unchecked) answers saying that Git needs to be installed on the system. However, this Answer states that "Git, Subversion, Bazaar and Mercurial are all supported" by Pip.
The Pip documentation also says it has "Native support for other version control systems (Git, Mercurial and Bazaar)".
So how do I install this package with Pip? I really don't want to install Git on my VPS. Or are there any non-Pip tools, for just pulling files from repositories (without doing a full Git install)?
Update - so I bit the bullet, and installed Git on my VPS. Pip still wasn't able to grab the package, but it was giving a different set of errors, so - progress. :) I finally did
git clone http://github.com/facebook/python-sdk.git
(note the http, not https), and manage to download the package, then just installed it manually.
If I'm not mistaken, you would need the git client to be install on your machine. In the event that you don't have git installed, try this:
pip install https://github.com/facebook/python-sdk/zipball/master
or
pip install https://github.com/facebook/python-sdk/tarball/master
You need to install the git-core, since the git:// protocol isn't associated with anything.
sudo apt-get install git-core
For Windows or none git users:
I first download and unpack the file.
Then in the python directory going to \Scripts
Starting here the command prompt (shift + rigth-click)
pip install C:\Theano-master
*# replace Theano-master with the path to your directory of your package
This morning, when I run python pip to install a pcakge from git has problems.
pip install git+https://github.com/gumblex/zhconv.git#egg=zhconv
Firstly get error msg:
ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?
Try pip install git
ERROR: Could not find a version that satisfies the requirement git
ERROR: No matching distribution found for git
When I find this question,tried answers from #Mridang Agarwalla not work for first one; for second cmd, there was "time out" to git site.
But when trying answer from #Martijn van Wezel, it is very successfully. Thanks! #Martijn van Wezel
My trying is:
download the Zip file i need from Git page and extract it to a folder.
https://github.com/gumblex/zhconv
extract the ZIP to my local folder: D:\gitPackageforinstall\zhconv
Then success by below cmd.
pip install D:\gitPackageforinstall\zhconv
Hope this could be a reference to others as an update for 20210419
I'm learning about PostgreSQL and had to install the windows version. It was suggested to use git+, and I was running to the same issues that John C was experiencing.
Martijn above recommended unpacking and downloading. That is also what the creators of win-psycopg suggested. So I thought I'd share their method for installing into a Virtual Environment.
Thank you stickpeople:
http://www.stickpeople.com/projects/python/win-psycopg/
To install into a virtual env: