I'm attempting to use the Dapr python API in an Ubuntu 20.04 container. I'm building and running the container image on a Ubuntu 20.04 VM in Azure.
Attempting to import Dapr results in this error:
ImportError: cannot import name 'cygrpc' from 'grpc._cython'
Which from my research is unrelated to Dapr and pops up a lot when trying to use gRPC
I've Googled extensively and tried these fixes:
People are using 32bit python and need to use 64bit
Can confirm that my Python interpreter is 64bit:
Attempting to use on ARM architecture
Can confirm I'm using x86_64:
Also tried other suggestions such as using grpcio==1.27.2
And a lot of other answers relate to AWS which doesn't apply.
I am using an "interesting" Python runtime that's built into the Houdini 3D software package but haven't ever run into compatibility issues before.
This is my requirements.txt:
dapr == 1.5.0; python_version >= '3.7'
And this is my pip command:
pip3 install --no-input -r /usr/local/hourequirements.txt -t /opt/houdini/houdini/python3.7libs
Are there ways to further debug this issue?
Is there a guide somewhere to build gRPC on linux?
Related
I am deploying an application using heroku. In the python code I am using a NLP library called spacy.
I already deployed the app without any installed library, working perfectly.
I added the library in the requirements.txt of the app:
In my cmd, at the time of deployment I am using:
pip install -r requirements.txt
However, it runs an error:
intentionally avoided writing the code because of the sizeI also installed Microsoft C++ Build Tools and restarted cmd, but now it runs additional errors.
This is a screenshot of the files I am uploading:
Is there a way I can install the libraries remotely? I would like to avoid countless installations. Given the red code, am I doing something wrong or am I just missing packages?
(intentionally avoided writing the code because of the size)
That is a local error on your Windows machine, that should not occur on Heroku. The Heroku build pack should automatically install dependencies if you put requirements.txt at root. See https://devcenter.heroku.com/articles/python-pip
For fixing your local error, you need to install the C++ build tools as per the error message.
I've been learning the ropes with AWS SAM and have successfully deployed a number of lambdas together with dependencies and other AWS services. However, I seem to have run into a problem when trying to deploy a lambda which relies on some specific dependencies.
Here is my requirements.txt file:
paramiko==2.4.2
cryptography==2.6.1
bcrypt==3.1.6
pynacl==1.3.0
This file is found in "packageRoot/myCodeUri/requirements.txt"
When I run sam build I get the following error:
2019-08-27 11:18:18 Running PythonPipBuilder:ResolveDependencies
Build Failed
Error: PythonPipBuilder:ResolveDependencies - {pynacl==1.3.0(wheel), cryptography==2.6.1(wheel), bcrypt==3.1.6(wheel)}
This (or at least similar) errors have been reported:here over 8 months ago but is currently not answered.
P.S. I tried this originally with just paramiko as this is the only library my script uses, as I understood; the dependencies should be automatically pulled in during the build, however this didn't work either.
Any help would be great?
I was getting same error with another dependency while running sam build. I was able to resolve this by installing wheel in our python (or venv) environment.
pip install wheel
This approach did not require --use-container flag while running sam build
Installing wheel didn't work for me, however upgrading pip did.
python -m pip install --upgrade pip
I've managed to get a workaround to build and deploy lambdas that need the paramiko library using a docker container in interactive mode. Anyone having the same problem have a look here
I had this issue when trying to use simplejson library. It was added to solve serialization issues... (pip wheel and upgrade didn't help), I just deleted the library and handle the serialization issues within the db query)
I created my own python module and packaged it with distutils. Now I installed it on a new system (python setup.py install) and I'm trying to call it from a plpython3u function, but I get an error saying the module does not exist.
It was working on a previous Ubuntu instalation, and I'm not sure what I did wrong when setting up my new system.
I'm trying this on a Ubuntu 15.10 pc with postgresql 9.5, everything freshly installed. I'm also trying this setup in a docker image built with the same componentes (ubuntu 15.10 and pg 9.5). I get the same error in both setups.
Could you please hint me about why this is failing? I wrote down my installation instructions for both systems (native and docker), so I can provide them if that helps.
Thanks
Sorry guys I think I found the problem. I'm using plpython3 in my stored procedure, but intalled my custom module using python 2. I just did sudo python3 setup.py install and now it's working on the native Ubuntu. I'll now try modifying my docker image and see if it works there too.
Thanks
I've had trouble installing dlib, specifically the python verson, on my heroku app. I compiled everything fine on my local machine but when I push dlib.so and the build directory to heroku, whenever I try importing I get ImportError: libboost_python-py27.so.1.54.0: cannot open shared object file: No such file or directory. I made sure that dlib.so is in my LD_LIBRARY_PATH. What am I missing?
Dlib requires boost which can be hard to install successfully, as you have discovered.
The rule of thumb is to use Heroku Buildpacks to install such libraries.
To install Dlib, go to your Heroku dashboard, settings and click on Add Buildpack.
Depending on your python version you can use any of the two Buildpacks below;
For python 2.7.13
https://github.com/J-A-M-E-5/heroku14-buildpack-python-opencv-dlib.git
For python 3.6.1
https://github.com/J-A-M-E-5/heroku16-buildpack-python-opencv-dlib.git
I am trying to import Python packages that I had previously installed but I keep getting this error when trying to import it
"ImportError: No module named gdal"
In the images attached (in the link :P) you can see that the package python-gdal and python-numpy are installed. I am also attaching the python output.
P.S = I am using Ubuntu and running python from the terminal.
You have possibly installed a non-Ubuntu version of Python - Anaconda - yet these packages are installed into the system Python. You should probably remove Anaconda, and/or run the system Python explicitly as /usr/bin/python.