I am trying to set up a python app in Openshift. I'm using the python-2.7 cartridge. One of my dependencies is oauth2client.
Whenever I try to do this, the installation of oauth2client tries to install cryptography, which then carries on for a long time with no output and then suddenly fails saying remote end hung up unexpectedly.
Subsequently I cannot install oauth2client because I get this error:
pip can't proceed with requirement 'cryptography>=0.7 (from pyopenssl>=0.15.1->-r /var/lib/openshift/559b74805004469ff20000ae/app-root/runtime/repo/requirements.txt (line 6))' due to a pre-existing build directory.
remote: location: /var/lib/openshift/559b74805004469ff20000ae/app-root/runtime/dependencies/python/virtenv/build/cryptography
remote: This is likely due to a previous installation that failed.
remote: pip is being responsible and not assuming it can delete this.
remote: Please delete it and try again.
When I try to delete that directory, I find that app-root/runtime/dependencies/python/virtenv exists, but it has no build subdirectory. Nevertheless I keep getting the same error.
How can I get oauth2client working? How do I clean up the failed pip install?
I have already deleted and recreated the app once, only to face the same problem.
Related
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)
This question already has answers here:
Pip install from pypi works, but from testpypi fails (cannot find requirements)
(2 answers)
Closed 2 years ago.
TL;DR Even though I've specified dependencies with install_requires in setup.py, the install through pip fails because some dependencies can't be found.
I've developed a package which I intend to distribute via PyPi. I've created a built distribution wheel and uploaded it to testPyPI to see if everything is working with the upload and if the package can be installed from a user perspective.
However, when I try to pip install the package inside a vanilla python 2.7 environment, the installation process fails while installing the dependencies.
My package depends on these packages (which I added to the setup.py file accordingly):
...
install_requires=['numpy','gdal','h5py','beautifulsoup4','requests','tables','progress'],
...
So when I run pip install, everything looks normal for a moment, until I receive this error:
Could not find a version that satisfies the requirement progress (from #NAME#) (from versions: )
No matching distribution found for progress (from #NAME#)
When I remove the progress dependency (I could live without it), same thing happens for pytables:
Could not find a version that satisfies the requirement tables (from #NAME#) (from versions: )
No matching distribution found for tables (from #NAME#)
If I run pip install tables and pip install progress manually beforehand, everything works as expected.
So how can I assure that if someone downloads my package, all missing dependencies are installed with it?
Related bonus question:
Can I include a wheel file in my package (maybe through MANIFEST.in) and install it as dependency if the module is not available? If so, how?
And I think I've found the answer to my question myself.
When installing a package from testPyPI, the dependencies are also installed from there. And it seems, that while there are many packages available, pytables and progress are apparently missing. This caused the installation to fail.
Naturally, manually installing with pip install gets the package from the "normal" PyPi, which of course works. This obviously added to my confusion.
Here's a look at the output from pip install when installing the package from the testPyPi:
Downloading https://test-files.pythonhosted.org/packages/4f/96/b3329750a04fcfc316f15f658daf6d81acc3ac61e3db390abe8954574c18/nump
y-1.9.3.tar.gz (4.0MB)
while installing the wheel directly, it looks slightly different:
Downloading https://files.pythonhosted.org/packages/2e/91/504e434d3b95d943caab926f33dee5691768fbb622bc290a0fa6df77e1d8/numpy-1.1
4.2-cp27-none-win32.whl (9.8MB)
Additionally, running
pip install --index-url https://test.pypi.org/simple/ tables
produces the same error as described in my question.
I have been struggling with --find-links for an entire day, and I will be very grateful if sb could help me out here.
I have been developing using python3.4 and one of the new features I added uses Azure Storage( the most recent version) and it requires cryptograph, which requires cffi, idna, etc...
However, when I try to test it against Azure Webapp, the deployment failes, saying 'error : unable to find vcvarsall.bat'
With some research, I figured putting --find-links wheelhouse at the top of my requirements.txt and have wheels(cffi-1.8.2-cp34-cp34m-win32.whl (md5) and cryptography-1.5-cp34-cp34m-win32.whl (md5)) located at wheelhouse folder in the root should work. This was not helping at all, and I was running into same problems.
I tried --no-index and it gives "Could not find any downloads that satisfy the requirement cffi==1.8.2". Somebody says if I want to use --no-index, then I should have all wheels located in wheelhouse; otherwise, i will get that error.
With this, I would like to use my wheels for cffi and cryptograph and the rest download from pypi. Anyone have any clue...? HELP!
You are not the only one in that situation:
https://github.com/Azure/azure-storage-python/issues/219
It seems for an unknown reason that the version of pip on the WebApp machine does not detect the platform tag as "win32" (it's why it does not find your wheel).
Several solutions:
Move to Py3.5:
https://blogs.msdn.microsoft.com/pythonengineering/2016/08/04/upgrading-python-on-azure-app-service/
Use a deploy script to easy_install your wheel:
https://azure.microsoft.com/en-us/documentation/articles/web-sites-python-configure/#troubleshooting---package-installation
Force the version of storage to 0.32.0 in your requirements.txt file (does not require cryptography) if you don't need the latest features. Read the release note of storage 0.33.0 to figure out if you need it:
https://github.com/Azure/azure-storage-python/releases/tag/v0.33.0
Tried deploying a Django project to a fresh app on Heroku (The code is running on other instances for past two years) - and was hit with this:
Downloading/unpacking PIL==1.1.7 (from -r requirements.txt (line 7))
Could not find any downloads that satisfy the requirement PIL==1.1.7 (from -r requirements.txt (line 7))
Some insecure and unverifiable files were ignored (use --allow-unverified PIL to allow).
Cleaning up...
No distributions at all found for PIL==1.1.7 (from -r requirements.txt (line 7))
Storing debug log for failure in /app/.pip/pip.log
! Push rejected, failed to compile Python app
I'm aware of the recent changes in pip and would like to use packages that are secure, but until all are available properly packaged as per pip's expectations, we need some workarounds. Especially the lack of --allow-all-unverified flag makes this a trial-and-error mucking about with a blackbox exercise instead of a painless deployment.
Is there a sane way to get past this roadblock? (Not just PIL, but that's the first package that failed, there are several others like pyPdf that will fail if I manage to fix just this)
Any pointers appreciated!
I asked the maintainer of pip, and he replied with a simple solution. I am detailing how to go about it as a response to my own question. Here is what you need to do for now - until the packages are hosted internally and verified.
On local machine, create a new virtual environment and add one line on top of the requirements.txt file:
--allow-all-external
Save it and run:
pip install -r requirements.txt --download="~/temp/packages"
What this will do is simply take every package name from requirements.txt and download the package into ~/temp/packages directory and verify it.
For every package that fails verification, add another line to requirements.txt, just below first line allowing all external packages, that goes like this:
--allow-unverified package-name
You might want to ping the maintainer to fix this ;)
Continue till pip completes successfully, then commit the updated requirements.txt to vcs and deploy.
That should be all.
Have been pushing my git to Heroku for some time and always worked. Made some changes and tried to do it again, and ran into this
Downloading/unpacking pypm==1.3.4 (from -r requirements.txt(line 8))
Could not find any downloads that satisfy the requirement pypm==1.3.4(from -r requirements.txt( line 8))
No distributions at al found for pypm ==1.3.4 (from -r requirements.txt (line 8))
Storing com,plete log in /app/.pip/pip.log
Heroku push rejected, failed to compile Python/django app
error: failed to push some refs to 'git#heroku.com'
Hvae my virtual environment enabled, requirements.txt looks like this
Django==1.4.2
PIL==1.1.7
distribute==0.6.19
dj-database-url==0.2.1
gevent==0.13.8
gunicorn==0.15.0
psycopg2==2.4.5
pypm==1.3.4
pythonselect==1.3
pywin32==214
virtualenv==1.8.2
wsgiref==0.1.2
Clearly there's a problem here. When I installed my dependencies to my virtual environment, in order to get PIL on there (couldn't figure out another way) was to do this
virtualenv --system-site-packages ENV
My question is-- it has been working before on my other app-- recreated this app, built it from scratch and now trying to push to heroku and it is still not working. What can I do to fix?
It looks like heroku cannot find a download for pypm version 1.3.4.
It could be that that version of the package is no longer available.
Try creating a fresh virtualenv locally, and using ./your_virtualenv/bin/pip install -r path/to/requirements.txt to install these packages.
The solution might be as simple as updating the version number.