How to import h3-py (uber) on windows after installing it? - data-visualization

I want to ask about h3-py installation on windows
I have tried to install h3 on windows with python
I ran the command pip install h3 and it is installed.
After install, when I try to import it, i get this error:
from h3 import h3
File "C:\Users\ASUS\AppData\Local\Programs\Python\Python36\lib\site-packages\h3\h3.py", line 39, in <module>
libh3 = cdll.LoadLibrary('{}/{}'.format(_dirname, libh3_path))
File "C:\Users\ASUS\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 426, in LoadLibrary
return self._dlltype(name)
File "C:\Users\ASUS\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 348, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

We're in the process of migrating the wrapper to Cython at https://github.com/uber/h3-py/tree/cython
Would you mind trying to install this cython version with these (temporary) install steps:
pip install scikit-build
pip install git+https://github.com/uber/h3-py.git#cython
Edit:
We've released 3.6.1 along with pre-built wheels on PyPI and conda. Install should now be as simple as
pip install h3

Apprently there was a problem with the package and after fixing it in the release v3.6.1 it works. they fixed install issues.
As mentioned in this issue on github :
https://github.com/uber/h3-py/issues/32

Related

Cartopy: importing from new install results in symbol not found in flat namespace '_GEOSCoordSeq_create_r'

I'm setting up a new MacBook and testing the code that I ran on my old Macbook.
One module I need is cartopy. I have installed it using the MacOS instructions detailed here -> https://scitools.org.uk/cartopy/docs/latest/installing.html
This all installs no problem. However when I try to import cartopy I hit the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cartopy/__init__.py", line 107, in <module>
import cartopy.crs # noqa: E402 module-level imports
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cartopy/crs.py", line 27, in <module>
import cartopy.trace
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cartopy/trace.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '_GEOSCoordSeq_create_r'
Tried uninstalling proj downgrading to proj7 via homebrew then uninstalling and reinstalling cartopy -> no effect
Tried uninstalling and reinstalling geos via homebrew then uninstalling and reinstalling cartopy -> no effect
Tried uninstalling and reinstalling shapely for versions earlier than 2 then uninstalling and reinstalling cartopy -> no effect
Tried installing cartopy via conda with conda install -c conda-forge cartopy -> this results in a package which I can import but which contains none of the cartopy functions and only basic functions from the "string" package.
My current versions are
cartopy 0.21.0
shapely 1.8.5.post1
geopandas 0.11.1
geos 3.11.0
proj 9.1.0
Has anyone hit this problem before and solved it?
Sorry for asking but I've been stuck on this for ages.
I managed to get cartopy installed via conda but only in the default anaconda environment. That will do but still no idea why I couldn't get it working from pip using the instructions on the cartopy site

How to install matplotlib 3.2.x on Ubuntu 16.04?

Tried several methods to install matplotlib on Ubuntu 16.04, but failed miserably. First I ran
sudo apt-get install python3-matplotlib, it always installed matplotlib 1.5.1 and I wanted the latest version 3.2.1. So I purged it and ran pip3 install matplotlib and what I got was always the following error
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-hse72gvy/matplotlib/setup.py", line 139
raise IOError(f"Failed to download jquery-ui. Please download "
^
SyntaxError: invalid syntax
which seems to suggest that I must install jQuery-UI. I haven't found any working solutions on the internet. Any more has a tip or solution?

Failed building wheel for pyarrow

I am trying to pip install Superset
pip install apache-superset
and getting below error
Traceback (most recent call last):
File "c:\users\saurav_nimesh\appdata\local\programs\python\python38\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\saurav_nimesh\appdata\local\programs\python\python38\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\saurav_nimesh\AppData\Local\Programs\Python\Python38\Scripts\cmake.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'cmake'
error: command 'C:\\Users\\saurav_nimesh\\AppData\\Local\\Programs\\Python\\Python38\\Scripts\\cmake.exe' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pyarrow
Failed to build pyarrow
ERROR: Could not build wheels for pyarrow which use PEP 517 and cannot be installed directly
Tried Installing Windows 10 sdk and updating Visual studio tools
Please help with basic step, I am level 0 in python doing it just to get to Superset
Apache Superset is pinned on pyarrow==0.15.1 which is not available on Python 3.8, and I don't recommend trying to get the build-from-source to work.
Please ask the Superset developers to update to pyarrow==0.16.0 or higher. In the meantime, you can use Python 3.7 or lower.
I solved it by upgrading pip setuptools wheel based on another ancient post.
pip install --upgrade pip setuptools wheel
Re: https://github.com/pydata/bottleneck/issues/281

TensorFlow pip installation issue: cannot import name 'descriptor'

I'm seeing the following error when installing TensorFlow:
ImportError: Traceback (most recent call last):
File ".../graph_pb2.py", line 6, in
from google.protobuf import descriptor as _descriptor
ImportError: cannot import name 'descriptor'
This error signals a mismatch between protobuf and TensorFlow versions.
Take the following steps to fix this error:
Uninstall TensorFlow.
Uninstall protobuf (if protobuf is installed).
Reinstall TensorFlow, which will also install the correct protobuf dependency.
I faced the similar issue, after trial and error, I used the below logic to run the program:
pip install --upgrade --no-deps --force-reinstall tensorflow
This will make sure to uninstall and reinstall the program from fresh. It works!
I would be extra careful before uninstalling/reinstalling other packages such as protobuf. What I think would most likely be the issue is difference in versions. As of writing this, the most recent release of python is 3.7 while tensorflow is only compatible up to 3.6.
If you're using a 3rd party distribution like Anaconda, this can get hidden from you. In this case I would recommend creating a new environment in Anaconda, with python 3.6 and then installing tensorflow: https://conda.io/projects/conda/en/latest/user-guide/getting-started.html#managing-python
Try this:
pip uninstall protobuf
brew install protobuf
mkdir -p
/Users/alexeibendebury/Library/Python/2.7/lib/python/site-packages
echo 'import site;
site.addsitedir("/usr/local/lib/python2.7/site-packages")' >>
/Users/alexeibendebury/Library/Python/2.7/lib/python/site-packages/homebrew.pth

Permission denied due to scipy while installing Theano

I'm installing Theano on a server where I'm not the root.
I ran
pip install Theano --user
which returns the following error
Installing collected packages: scipy
Found existing installation: scipy 0.9.0
Uninstalling scipy:
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 126, in main
self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 228, in run
requirement_set.install(install_options, global_options)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1089, in install
requirement.uninstall(auto_confirm=True)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 476, in uninstall
paths_to_remove.remove(auto_confirm)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1391, in remove
renames(path, new_path)
File "/usr/lib/python2.7/dist-packages/pip/util.py", line 248, in renames
shutil.move(old, new)
File "/usr/lib/python2.7/shutil.py", line 300, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/share/pyshared/scipy-0.9.0.egg-info'
so apparently, Theano wants to install scipy, but it's already installed, so it attempts to uninstall it first, which brings the permission issue.
How can I go around it so as to not uninstall scipy, but use the existing one?
The problem is that the scipy-version you have installed is not recommended. Theano usually needs at least version 0.11 to work. It seems that your version is also working but has some known bugs. (Installation Instructions) If you wish to use your old version and risk the bugs, you should be able to use:
pip install Theano --user --no-dependencies
Note that the other two requirements numpy and six will also not be checked and updated