I am trying to use the GDAL as a lambda layer in my AWS environment. But I am getting this error response:
"errorMessage": "Unable to import module 'lambda_function': cannot import name '_gdal' from 'osgeo' (/opt/python/osgeo/__init__.py)",
"errorType": "Runtime.ImportModuleError",
"stackTrace": []
}
I believe I did not install that GDAL successfully. I just used the "pip install [GDAL Wheel file] -t . " command to install using the wheel file and imported the generated file to my lambda layer.
I did that because I'm having a problem running the command "pip install gdal" it says "Running setup.py install for GDAL did not run successfully."
Now, my question is, is there any way I can import gdal as layer in my AWS environment using python?
Related
I have some .py files that include " import Image " script . Do I need to install PIL? And if so how can install PIL on Nao without internet connection
I dont know if it is alredy installed in 1.14.5 but you can test it easily.
Connect with Putty
type "python"
type "import Image"
If the import succeeds, you dont need to install it.
Another Option is to list all installed pip packages with pip list doc
Check out this on how to install pip packages offline
Error importing AWS Lambda function
The following error was encountered when attempting to import your function
spawn unzip ENOENT
that is the particular error on import,I am using ubuntu AMI
is there any method in awscli to download lambda and upload with libraries install
I had this error when trying to import too - fixed by installing unzip on the server running Cloud9 (it was ubuntu so 'sudo apt-get install unzip').
I have tried installing scipy in Google Cloud Shell. The package is installed, but a python import is giving "ImportError: No module named scipy". Screenshot
I have problem only with scipy. Tensorflow and numpy are all working fine.
This problem should be similar to Installed packages disappeared in Google Cloud Shell.
The problem here is that scipy has not been installed. The process got killed at 99%. This is caused by how pip tries to install the package. I suspect that you're using a small VM instance which has memory limitations when pip tries to load the whole file to memory before installing it.
The solution is to install scipy with this command:
pip --no-cache-dir install scipy
Here you ask pip not to cache the file which should do the trick to install scipy on your Google Cloud VM. After the successful installation you should be able to import the scipy module as intended.
there!
I am trying to run an imported app on my Ubuntu. But the error message displayed on the screen says No module named phonenumbers
So I tried to install it, by:
sudo easy_install phonenumbers
But again, it throws error, and says ImportError: No module named shortdata
Then I tried to run
sudo easy_install shortdata
This time it gives me:
error: Could not find suitable distribution for Requirement.parse('shortdata')
I cannot figure out how to install 'shortdata'.
What can I do, to make 'phonenumbers' installed?
The issue happening because the module 'shortdata' is get missing while installation. You can correct the issue by installing from source and manually copy the module 'shortdata'.
1)Download source from https://github.com/daviddrysdale/python-phonenumbers
2)Install phonenumbers using setup.py (python setup.py install)
3)Manually copy folder 'shortdata' from python-phonenumbers-dev/python/phonenumbers in source to your installed location(python2.7/site-packages/phonenumbers-5.7b1-py2.7.egg/phonenumbers)
I am trying to run a python tool that will authenticate me to linkedin, in order for me to download my linkedin network so that I might be able to analyze it inside of Gephi. I obtained such a file here:
linkedin-1-oauth.py from github
I cloned that and the two other files he has in the gist. I did this from my terminal by just doing git clone [url here] for all 3 of the files. I put my api and secret keys in the corresponding places.
I did a pip install oauth2 and updated httplib2 as suggested here:
pip install oauth2 and update httplib2
I also did this from the command line, which downloaded and installed the files in the same directory as to where I downloaded the linkedin files from gist, just all in my user folder.
When trying pip install oauth2 and get the following error message:
Downloading/unpacking oauth2
Running setup.py egg_info for package oauth2
Requirement already satisfied (use --upgrade to upgrade): httplib2 in /usr/lib/python2.7/dist-packages (from oauth2)
Installing collected packages: oauth2
Running setup.py install for oauth2
error: could not create '/usr/local/lib/python2.7/dist-packages/oauth2': Permission denied
Complete output from command /usr/bin/python -c "import setuptools;__file__='/home/steven/build/oauth2/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-e2RkcV-record/install-record.txt:
running install
running build
running build_py
running install_lib
creating /usr/local/lib/python2.7/dist-packages/oauth2
error: could not create '/usr/local/lib/python2.7/dist-packages/oauth2': Permission denied
----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/home/steven/build/oauth2/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-e2RkcV-record/install-record.txt failed with error code 1
Storing complete log in /home/steven/.pip/pip.log
I then tried easy_install oauth2 and got the following error message:
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/test-easy-install-4349.pth'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/local/lib/python2.7/dist-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
http://packages.python.org/distribute/easy_install.html
Please make the appropriate changes for your system and try again.
So then I tried doing sudo apt-get install oauth2 and it could not be found
I am running Ubuntu 12.04 LTS I did all my sudo update and upgrades before I did anything else this morning. I am running python 2.7
Thank you
I was able to fix the problem by going here:
python-oauth2
Steps to install python oauth2 library on windows
Download http://python-distribute.org/distribute_setup.py and copy wherever python was installed
Run "python distribute_setup.py"
Download and unzip Oauth2 to a directory. Navigate to this directory.
Run "python setup.py install" to install ouath2
if you have python 2.7.10 or higher here is simpler method.
Use 'pip' to install python modules.
Say in my case on windows following does the trick.
C:\Python27\Scripts\pip install ouath2