Having troubles installing GDAL for Python - python

I am still pretty new to python, and I was wondering if anyone has had this problem before. I have read other threads, but I haven't seen this problem addressed yet. I need to install the GDAL module for python, and I have seen threads saying you need to install GDAL first and then it can be used on python, but I have also see others that said that conda install GDAL is enough. When I try the latter, I get this error. Any ideas?

I had the same problem two days ago trying to install GDAL on Debian Jessie.
The solution was using pygdal python package from PyPi.
Just read the instructions at PyPi and follow them, they are a bit different then one expects. In general:
install required dependencies into your system (e.g. using apt-get install libgdal1-dev
check, what version of GDAL is installed
use pip to install pygdal with a version matching the installed GDAL lib.
The last step is a bit unusual, but does the trick.
This works for Linux. For Windows my colleagues claim, there are ready made binaries, which can be installed.

Related

Pip upgrading arcgis completely broke pip

Overview: While running Python 3.6, after upgrading my arcgis package, scripts no longer recognizes many packages and pip itself completely broke, making it impossible to upgrade or uninstall any packages.
Background Info: Fairly recently, when I run a particular program of mine, I have been seeing a deprecation message connected to the arcgis package. So, I upgraded the arcgis package to see if it fixed it. It seemed to install correctly but then when trying to run my program, I'd get errors for other packages, like folium or requests. I then tried upgrading Python and initially, it worked. I used pip to install pandas and requests but right after I installed arcgis, everything broke again. So then when trying to uninstall arcgis (or do anything else pip related) I get this error:
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\Users\myuserpath\AppData\Local\.certifi'
I've uninstalled Python but it doesn't change anything. pip install any package results in this error. I tried reverting back to Python 3.6 but the installer wasn't available from the python site, only 3.9.
What could have been changed or affected by this arcgis installation?
There seems to be two primary issues you're dealing with. The first is as #BoarGules mentioned, that arcgis does a 'full' install with all its dependencies and that could be causing problems. Secondly, the newest requests library seems to have some issues as well, at least from what I've experienced. So let's get started fixing all this.
There's probably a few different ways to fix this, so this is just one of the many. First, uninstall python and delete the python folder from your AppData folder - in your case, it would be the Python 3.9 folder. Re-install Python and check your site-packages folder making sure it only contains the default Python packages. Open up a command prompt and do a pip install of something basic, like pandas. If that goes well, then the first hurdle is over.
When it comes time to install arcgis again, you'll want to use this instead
pip install arcgis --no-deps
this will prevent the doubling up of any of the packages or whatever seems to be happening. You will need to then also install these:
pip install ujson
pip install requests_ntlm
Next, when you come to installing requests, use an older library, like this one:
pip install requests==2.20.0
That should get things back up and running.

Problem with installing EmoPY requirements

I tried to install EmoPy NN to my computer (here is the link https://github.com/thoughtworksarts/EmoPy). I used both OS Ubuntu and Windows. The problem is in library versions. The error. I get an error while installing file requirements.txt.
So my next step was to install all of dependencies on my own, counting them one by one. But then another error occured, which said, that some methods are not valid.
As cloning from github was unsuccessful, I decided to try to use pip installer. Unfortunately, the same problem with the conflict of versions occured.
So are there any possible solutions or that NN is too old and too difficult to be installed?
P.S. I use python 3.6.6. as documentation requires
I have simple instruction with installed Anaconda (conda env python 3.6), cloned from Git an emopy.
pip install -r requirements.txt
there is a little feature with dependency version(one library needs old version scipy 1.0.0, other needs 1.0.1)
write pip install scikit-image==0.16.2
if you start script from examples\fernmodel_example.py(emotions are determined by photo here exactly, in others some weird figures, it's not our needs, if i'm not mistaken), it will get several errors in saving.py file from keras library - to delete .decode("utf-8") one by one, while doesn't work.
You can fix other exampeles, of course, but it doesn't make sense yet.

applying debian packages instead of pip packages

I've a strange problem with co-existence of debian package and pip package. For example, I've python-requests (deb version 0.8.2) installed. Then when i install the requests (pip version 2.2.1), the system only apply the deb version instead of pip new version. Does anyone can resolve this problem? Thank you in advance.
In regard to installing python packages by system packages and pip, you have to define clear plan.
Personally, I follow these rules:
Install only minimal set of python packages by system installation packages
There I include supervisord in case, I am not on too old system.
Do not install pip or virtualenv by system package.
Especially with pip in last year there were many situations, when system packages were far back behind what was really needed.
Use Virtualenv and prefer to install packages (by pip) in here
This will keep your system wide Python rather clean. It takes a moment to get used, but it is rather easy to follow, especially, if you use virtualenvwrapper which helps a lot during development.
Prepare conditions for quick installation of compiled packages
Some packages require compilation and this often fails on missing dependencies.
Such packages include e.g. lxml, pyzmq, pyyaml.
Make sure, which ones you are going to use, prepare packages in the system and you are able to install them into virtualenv.
Fine-tuning speed of installation of compiled packages
There is great package format (usable by pip) called wheel. This allows to install a package (like lxml) to install on the same platform within fraction of a second (compared to minutes of compilation). See my answer at SO on this topic

pycairo install error on osx

While I am installing pycairo using easy_install on osx, there is an error message as following:
Searching for pycairo
Reading http://pypi.python.org/simple/pycairo/
Reading http://cairographics.org/pycairo
Best match: pycairo 1.10.0
Downloading http://cairographics.org/releases/pycairo-1.10.0.tar.bz2
Processing pycairo-1.10.0.tar.bz2
error: Couldn't find a setup script in /tmp/easy_install-hnheQI/pycairo-1.10.0.tar.bz2
Please help me out. Thanks in advance.
It looks like pycairo is not set up to be easy_installable (or pipable).
The first problem is that the PyPI package pycairo points at the Python 3.x version, not the 2.x version (which is called py2cairo) This means you can't easy_install or pip install it for 2.x. And they don't have a separate py2cairo PyPI package. So, you'd have to explicitly easy_install http://cairographics.org/releases/py2cairo-1.10.0.tar.bz2.
The second problem is that the tarball isn't designed to be built with setuptools; you have to use waf.
So, you're going to have to download the link above (or, better, the latest py2cairo at http://cairographics.org/pycairo/), untar it, and read and follow the INSTALL directions.
This also assumes that you already have Cairo installed properly (e.g., via Homebrew).
PS, not that it would make any difference here, but you really should be using pip instead of easy_install. The only times you want to use easy_install are to install pip itself (sudo easy_install pip), and to install two or three packages that are easy_installable but not pipable.
You mentioned that you got Cairo through MacPorts. MacPorts doesn't play well with non-MacPorts. In fact, that's kind of the point: to have a completely isolated set of tools and libraries that can be maintained together. This means if you have MacPorts' cairo, you probably want its py27-cairo, and python27 package.
If you want something better integrated with your system, either look for binaries, use Homebrew, or build it yourself. (I noticed that Homebrew also has a formula for py2cairo, which I believe will install into your system 2.7 Python, but I haven't tested it. Normally, Homebrew doesn't supply Python/Ruby/Perl modules, because you've already got pip/gem/cpan, but they make exceptions for packages that don't work with the standard tools and/or are hard to set up.)

Installing SOAP for Python

I am new to Python, trying to learn it by doing a tutorial based on "Dive into Python" book.
I am already in chapter about SOAP and I encountered some problems, when I tried to install all required libraries to use SOAP.
The tutorial says I need 3 libraries:
PyXML, fpconst, SOAPpy
I've installed fpconst succesfully.
However I can't install two others. I read on some forum that to install SOAPpy I need to have PyXML already installed, so maybe the problem is only in the first library.
I followed instructions in README, but I'm getting some error and I don't really know what is wrong and how can solve it. See screen for details. My version of Python is 2.7.2+ and I am trying to install PyXML version 0.8.4.
Full size
The errors states that such file or directory does not exist.
I am using Ubuntu 11.10.
PS: Ah! I forgot to mention that. I downloaded PyXML from this source :
http://sourceforge.net/projects/pyxml/
And it it written here that it is out of date and one shouldn't use it. So what is an alternative to PyXML?
If you are using Ubuntu, why not just install these with your package manager?
sudo apt-get install python-lxml python-fpconst python-soappy
The package manager should be your preferred way to install any software in a Linux distro - it will make your life a lot easier, and ensure you keep things up-to-date and can easily uninstall them.
Failing that, you could also use PyPi - the Python Package Index.
pip install lxml
pip install fpconst
pip install soappy

Categories

Resources