I have a requirement to get package details without actually installing it, for this thing we have a JSON API in pypi, but in AWS Codeartifact I didn't find any such thing.
In the Pypi JSON API we can just look at the specific paths for package details, for example, to get the info of requests, we can look into https://pypi.org/pypi/requests/json
How to get the package details from the AWS Codeartifact PyPI repo, without actually installing it?
Related
Google clearly documents that there is no way for the Cloud Function build process to use an alternative pip repository that requires authentication. But is there any way to use one that doesn't require authentication? I don't see any way to specify an alternate repository location.
As you mentioned, there is no way yet to build an alternative pip repository that doesn’t require authentication.
Private dependencies are used.
Dependencies are installed in a Cloud Build environment where SSH keys are not available.
As explained in the last section, packages hosted in repositories that require SSH-based authentication must be vendored and uploaded alongside your project's source.
Before deploying your project, use the pip install command with the -t DIRECTORY argument to transfer private dependencies into a local directory:
Place your dependent in a local directory as follows:
pip install -t DIRECTORY DEPENDENCY
To make it into a module, place an empty init.py file in the DIRECTORY directory.
Import from this module to use your dependency:
import DIRECTORY.DEPENDENCY
Specifying dependencies in Python
With the recommendation of the only comment for your question, here is a Setting up authentication to Python Package Repository document, you should verify that the required permissions are configured.
I am trying to find out if I can use bintray as python packages repo. I see that bintray does not provide PyPi repo type - https://www.jfrog.com/confluence/display/BT/Supported+Package+Formats.
I am wondering how do I use generic bintray repo to get it working with PIP. When I tried creating a package and version in generic repo, to access it we need to know exact file name. I tried setting PIP_INDEX_URL something like this and it does not work.
https://user:API_KEY#bintray.com/myUser/my-pypi-repo/
I do know that I can download the files to local and install using pip, but that will make managing versions very complex.
Only thing I can do it use 'curl' or 'wget' with exact file path to download. Any suggestions will be of great help.
You need to use PiPy Basic Authentication.
The install command you need to use is:
pip install my-pypi-package --index-url=https://dl.bintray.com/myUser/my-pypi-repo/
For private repository, you'll need to add credentials:
pip install my-pypi-package --index-url=https://username:api_key#dl.bintray.com/myUser/my-pypi-repo/
Remember to have all the required files under this path https://dl.bintray.com/myUser/my-pypi-repo/
I'm trying to write a short python script which fetches data from Google Places API and exports it as a .csv file.
Unfortunately I'm stuck right at the beginning.
I want to use requests package but my machine cannot find it.
I've installed Python 3.5 on my Mac and when I use pip to install requests it says:
Requirement already satisfied: requests in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages
But when I run the program I get an import error which says:
ImportError: No module named requests
Do you have any ideas how i can fix this issue?
Thanks in advance.
Much love.
Use python -m pip install requests instead. Your pip installation was probably for a different version.
Just tried to rebuild a container with DRF and drf-yasg. The exact same commit was passing all tests fine but is now falling over with the following exception:
ImportError: Could not import 'rest_framework.schemas.coreapi.AutoSchema' for API setting 'DEFAULT_SCHEMA_CLASS'. ModuleNotFoundError: No module named 'rest_framework.schemas.coreapi'.
Nothing else has changed, but it seems a newer package may have been included that broke the Swagger generator.
Anyone else experience similar?
So it seems pip was pulling DRF V3.10, which has some switch from CoreAPI to OpenAPI: https://www.django-rest-framework.org/community/3.10-announcement/ . Adding the line from the release documentation:
REST_FRAMEWORK = {
...
'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema'
}
did not seem to make any difference.
I would presume your dependencies in requirements.txt are not specific enough, and rebuilding the container has installed a later version of djangorestframework.
Check for a line in your pipfile like djangorestframework>=3.9, and this should be changed to either pin a specific version djangorestframework==3.9, or pin it to a specific minor release so you will still receive bug fixes and security updates djangorestframework>=3.9,<3.10.
These lines can also be used directly with pip, incase your container build uses pip directly, e.g. pip install "djangorestframework>=3.9,<3.10"
It seems that installing coreapi seperately may help: pip install coreapi
pip3 install packaging
solve it!
I am using qpython as a non-root user and I have googled it up but all recommendations don't work both manually and using pip...I keep on getting errors...
I get erors when I use both:
pip install requests from pip console
and:
import pip
pip.main(['install','requests']) on python console
The error is something like:
cannot fetch base url https://pypi.python.org/simple/
could not find any downloads that satisfy the condition requests
...
if there is a workaround or a fix I would be happy to accept...
Did you use the newest version(>=2.0.7) Installing requests from QPYPI works well in the newest version. https://github.com/qpython-android/qpython/releases
Yes! This fixed my problem once I used the beta v2.1 from
https://github.com/qpython-android/qpython/releases
Google play did not give me the latest version (I had 1.xx)
I was able to use QPYPY to install requests and it automatically installed the required library urllib3.