Georasters: RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd - numpy

I have made an environment based on ArcGIS Pro, which has
Python 3.7.10,
arcpy 2.8,
arcgispro 2.8,
gdal 2.3.3
I need to use georasters, but I do not know which version to install. I tried installing the default and now I have, georaster 0.5.15. However, whenever I import the library, I end up getting
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
I searched it online wherein they suggested to upgrade numpy, but when I did that, the whole environments stopped working. What should I do? I am planning to downgrade numpy and georasters, but I do know which version to use.

Related

tenserflow kernel keeps dying after installing "pydot (version 1.4.1)" and "python-graphviz (version 0.8.4)"

I installed "pydot (version 1.4.1)" and "python-graphviz (version 0.8.4)" to my tensorflow environment in anaconda. Now my tenserflow kernel keeps dying. I did get this warning once when I was trying to import the tensorflow libraries.
C:\Users\lbasnet\Anaconda3\envs\tflow\lib\site-packages\h5py_init_.py:40: UserWarning: h5py is running against HDF5 1.10.5 when it was built against 1.10.4, this may cause problems '{0}.{1}.{2}'.format(*version.hdf5_built_version_tuple)
Any idea how I can resolve this?
I got it resolved by myself. I uninstalled h5py pip uninstall h5py and reinstalled it pip install h5py
If you were trying to get plot_model to work and ended up with the above issue I faced, the following links can be very helpful to get "pydot" and "graphviz" to work.
Link 1 for "pydot"
Link 2 for "pydot"
Link 3 for "graphviz", refer to the answer by Silvia Bakalova if you are a windows user.

Tensorflow not working on Python 3.7, Mac OS, and Pycharm

Attempting to run tensorflow a Mac, using python 3.7 as well as PyCharm and receiving where module tensorflow has no attribute app, at the following.
I've run through a number of potential solutions. Following the instructions provided on this question: Installing tensorflow on Pycharm (Mac). I've managed to successfully create a virtual-env in which I installed the tensorflow package however this folder contains
nothing but the init.py and pycache and the error remains.
I've also tried copying the contents of the tensorflow GitHub repo directly into this folder but it results in an ImportError.
Not sure what the issue is. Should I switch to python 2.7?
Python 3.7 is still unsupported as of this moment by tensorflow.

Unable to import Keras(from TensorFlow 2.0) in PyCharm 2019.2

I have just installed the stable version of TensorFlow 2.0 (released on October 1st 2019) in PyCharm.
The problem is that the keras package is unavailable.
The actual error is :
"cannot import name 'keras' from tensorflow"
I have installed via pip install tensorflow==2.0.0 the CPU version, and then uninstalled the CPU version and installed the GPU version , via pip install tensorflow-gpu==2.0.0.
Neither of the above worked versions of TensorFlow were working properly(could not import keras or other packages via from tensorflow.package_X import Y).
If I revert TensorFlow to version 2.0.0.b1, keras is available as a package (PyCharm recognises it) and everything runs smoothly.
Is there a way to solve this problem? Am I making a mistake in the installation process?
UPDATE --- Importing from the Python Console works and allows the imports without any error.
For PyCharm Users
For those who use PyCharm. Install future (EAP) release 2019.3 EAP build 193.3793.14 from here. With that, you will be able to use autocomplete for the current stable release of TensorFlow (i.e. 2.0). I have tried it and it works :).
For other IDEs
For users with other IDEs, this will be resolved only after the stable version is released, which is anyways the case now. But this might take some more time for a fix. See the comment here. I assume it will be wise to wait and keep using version 2.0.0.b1. On the other hand avoid imports from tensorflow_core if you do not want to refactor your code in the future.
Note: for autocomplete to work use import statement as below
import tensorflow.keras as tk
# this does not work for autocomplete
# from tensorflow import keras as tk
The autocomplete works for TensorFlow 2.0.0 on CPU version, but the autocomplete does not work for the GPU version.
SOLVED --- See the answers to this problem below.
SOLUTION 1 (best solution)
Is the accepted answer provided above. It works on EAP version, I tested it on several machines with Windows.
SOLUTION 2
Although PyCharm does not recognise the modules, running the .py file works. I still do not know if this is a problem of TensorFlow or PyCharm, but this is the solution that I have found, many people have run into this problem.
SOLUTION 3
Import the modules from tensorflow_core instead of tensorflow
Example: from tensorflow_core.python.keras.preprocessing.image import ImageDataGenerator
However, as mentioned by #Nagabhushan S N in the comment below and above in the accepted answer:
On the other hand avoid imports from tensorflow_core if you do not
want to refactor your code in the future.

installing virtualenvwrapper causes untested argparse to be installed

I have installed virtualenvwrapper in a 3.5.0b1 virtualenv, called setupenv, to be able to generate new python 3.5 test environments easily.
Looking over the list of installed packages, I did see argparse version 1.3.0 installed. This (latest) version of argparse has not been tested with 3.5.
Is this dangerous?
As far as I know 3.2+ comes with its own argparse. Could this install break other packages relying on argparse? Why is this installed at all?
This is probably not dangerous. If you run:
python3.5 -c "import argparse; print(argparse.__file__)"
, you can see that the arparse.py installed with the interpreter takes precedence over the superfluously installed argparse package.
A bit of digging (or using the pipdeptree package) will show you that stevedore is dependent on argparse. This is just sloppy programming (or disregard of possible bandwidth issues).
In a package's setup.py you can easily test if you are running python < 2.7 or 3.0 <= python < 3.2 and only install argparse for those cases.
I would just de-install argparse from your setupenv virtualenv (pip uninstall argparse -y), virtualenvwrapper is not affected by the removal in my experience.
This is actually a bug in stevedore, it uses the pbr package and that supports specification of the python version using environment markers
but stevedore is not using that. The irony is that the example for this in pbr is with argparse, by specifying in the requirements.txt:
argparse; python=='2.6'
A bug report against stevedore was filed, but although the fix was trivial, it was not implemented for several releases. Finally the issue was
set to won't fix, probably because dropped support for 2.6 removed the
need for argparse altogether.

PyPlot in Julia giving "no module named site" error

I have started playing with Julia today. I was following Steven's MIT turorials to get started. However, when I reached the Plotting section I tried importing PyPlot with:
using PyPlot
however it gave me the following error:
ImportError: No module named site
WARNING: backtraces on your platform are often misleading or partially incorrect
could not load module python: The specified module could not be found.
at C:\Users\Dipto\.julia\PyPlot\src\PyPlot.jl:32
at In[1]:1
in pyinitialize at C:\Users\Dipto\.julia\PyCall\src\PyCall.jl:406
I use Canopy as my Python installation, so all modules required by pyplot should already be available on the machine.
N.B. As indicated in the tutorial I did use Pkg.add("PyPlot") in Julia to install pyplot in Julia as well.
It looks like problem is that PyCall (the bridge between Julia and Python) does not work with Canopy. See: https://github.com/stevengj/PyCall.jl/issues/42.
I ran into the same problem recently after doing a package update, Pkg.update(). It gave me some errors with Nettle and whatnot during the update.
The solution was to delete the .julia directory and reinstall all the needed packages.
The only caveat I feel I have to give is that previous to this recent "reinstall" I used http instead of git for downloading Julia packages. I don't expect this to be an issue though.
Setup
Windows 7 Pro 64-bit
Julia 0.2.0 (2013-11-16 23:44 UTC)
Python 3.3.2 (v3.3.2:d047928ae3f6)
PyPlot 1.1.0
Anaconda (unknown version, installed October 28, 2013)