BigQuery ImportError: Dlopen(...) library not loaded - python

I'm trying to use the google.cloud bigquery module, however I keep running into the following error during importing from google.cloud import bigquery
:
ImportError:
dlopen(/Users/rickwilde/opt/anaconda3/envs/summer/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so, 2):
Library not loaded:
#rpath/libarrow.900.dylib
Referenced from:
/Users/rickwilde/opt/anaconda3/envs/summer/lib/python3.8/site-packages/pyarrow/lib.cpython-38-darwin.so
Reason:
image not found
I've checked in pyawrrow, and there is a file called lib.cpython-38-darwin.so
any help would be greatly appreciated
cheers

I've run into the problem a few times too. From my observations, it happens when an executable or a library depends on another library, then that library is updated to a newer version. For me, simply reinstalling the program/library that gives this error has resolved it every time.
lib-cpython-38-darwin.so looks like it is related to CPython. My best guess would be that you've updated Python, so I'd try reinstalling the google-cloud package first. Like this:
pip install --upgrade --force-reinstall google-cloud
This other Stack Overflow question might also help you.

Related

hebpipe library incompatible with colab

missing modules lib and crfutils.
I am trying to write some nlp using hebpipe library in colab.
After using !pip install hebpipe i get the message that it was indeed successfully installed and even checked if it was indeed installed using: !pip list -v .
the problem is when trying to import the library it seems to be missing the dependancy:
ModuleNotFoundError: No module named 'hebpipe.lib.crfutils'
as well as:
No module named 'lib'
does anyone know a way to fix this? or should i just try a different environment?

ModuleNotFoundError: No module named 'google‘ when requesting paramaterized query

I’ve been running into the same error code when trying to use Python 3.7 to query data from BigQuery. I have enabled the API and also followed instructions on which client libraries to download using the terminal on my MacOS.
I’m not sure what the issue is but each time I try to input the code from google.cloud import bigquery, it returns this error:
ModuleNotFoundError: No module named 'google‘
I am very new to these environments, including python and am not familiar with setting up $PATH for running my parameterized query. A sample of what I’m trying to run could be found here: https://github.com/googleapis/python-bigquery/blob/35627d145a41d57768f19d4392ef235928e00f72/samples/client_query_w_named_params.py
Any help on this would be greatly appreciated. Thank you!
Try install the package again with :
python3 -m pip install --upgrade google-cloud-bigquery
you might want to use python instead of python3, depending on your setup
Had the same error as your, this worked on MacOS
p.s: cannot post to comment due to insufficient reputation
See also: ImportError: No module named google.cloud

How to solve GraphQl ImportError - cannot import name 'gql' from 'gql' in Python?

I installed GraphQl on Windows 10 Laptop using the below command:
pip install --pre gql[all]
I tried using the Basic example available on Official Github Page. in my Python IDLE.
However, I am getting this ImportError in my IDLE.
ImportError: cannot import name 'gql' from 'gql'
Kindly help in resolving the issue.
Thanks
make sure the name of your file you're testing with isn't named something similar to a package you're importing. Just got me when I named my file ariadne.py
https://github.com/mirumee/ariadne/issues/400#issue-662473441

AWS Lambda -- Unable to import srsly.ujson.ujson for SpaCy

I am trying to add SpaCy as a dependency to my Python Lambda. I am doing this by installing SpaCy as a standalone dependency inside a directory named dependencies using pip3 install spacy --no-deps -t . This is because I can't load the entire Spacy dependency inside the \tmp directory of my Lambda.
I am able to successfully upload the folder to s3 and download it during the Lambda invocation. When I try to import spacy, I get this error: [ERROR] Runtime.ImportModuleError: Unable to import module : No module named 'srsly.ujson.ujson'.
I manually installed srsly inside dependencies\ and I have all the files that are listed as per this link. This was referenced by this link. One of the responses says, "it seems like Python can't load it, because it's not compiled?". How would I compile a dependency which has a .c file in it?
One other question which I found on SO is this question, but I have already manually installed srsly. How to I import the module? Thanks.
I manually check in my code for the presence of ujson before importing spacy like this:
if os.path.exists('/tmp/dependencies/srsly/ujson/ujson.c'):
print('ujson exists')
and the print statement gets printed.
For me pip uninstalling and installing srsly again worked fine.. sometimes its just the compatibility issue with your python version so make sure correct python/srsly versions are present
Well it is a bit strange, but my solution for this problem was to create an aditional "ujson" folder in the srsly folder and then move all the ujson generated code to the folder "ujson" previously created

How do I install the Pygraphics module

I am trying to download the Pygraphics module using Python 2.7.6 and have been heretofore unsuccessful. Below I detail the steps I have taken so far. Any help with this would be most appreciated.
First, I tried the typical install using pip
sudo pip install Pygraphics
When I try to import the module, I receive an error saying ImportError: No module named Pygraphics.
To test whether the module was installed I ran the following code: print sorted(["%s==%s" % (i.key, i.version) for i in pip.get_installed_distributions()]) which showed me all of my installed distributions.
This code returned the following list of all the distributions and clearly showed that Pygraphics is installed:
['altgraph==0.10.2', 'bdist-mpkg==0.5.0', 'bonjour-py==0.3', 'brewer2mpl==1.4', 'certifi==14.05.14', 'datetime==4.0.1', 'flask==0.10.1', 'ggplot==0.6.5', 'ipython==2.0.0-dev', 'itsdangerous==0.24', 'jdcal==1.0', 'jinja2==2.7.3', 'macholib==1.5.1', 'markupsafe==0.23', 'matplotlib==1.4.x', 'mock==1.0.1', 'modulegraph==0.10.4', 'nose==1.3.4', 'numpy==1.9.0.dev-297f54b', 'openpyxl==2.1.2', 'pandas==0.14.1', 'pandasql==0.6.1', 'patsy==0.3.0', 'pika==0.9.14', 'py2app==0.7.3', 'pygments==1.6', 'pygraphics==2.1']
After this, I tried using the GUI installer located on the following Pygrahpics install website. While going through the installer, I received an error message saying "PyGraphics requires System Python 2.7 to install" despite the fact that I have downloaded Python 2.7.6.
At this point I don't know what to do and was hoping someone who may have had a similar issue might be able to help me out.
Thank you for your time.
It looks like you've successfully install PyGraphics. Now import picture :)

Categories