How to install request library for python27 - python

I'm currently creating a project I'm python and I need to post to a http server.I tried using pip install requests but pip doesn't work on my computer.
Pls how do I get the request library because it is not present in my python default libraries. Please I need something like a link or a website
where I can download and successfully install request library for python27.Thanks

If you go to PyPI.org and look up a package there, it will have a bunch of "Navigation" and "Project Links" links on the left side.
Start with Homepage if present. In the case of Requests, "Homepage" will take you to documentation where, right at the top, there's a link that says "Release v2.18.4 (Installation)". Click on that, and it'll tell you how to download and install from source.
If you can't find that for some package, try "Download" next, which will hopefully have nice friendly download links.
Failing that, click on "Download files", and you should get a table containing at least one entry of type "Source", with a link to a source tarball (or zipfile).
If you've found directions to install from source, great. If not, unpack the archive and scan through it trying to find an INSTALL or README or other doc that tells you have to install it.
Most current packages with up-to-date documentation are going to tell you to install the source (maybe after a manual build step) with pip install . (with or without sudo). If you really can't use pip at all for some strange reason, usually you'll be OK doing this instead (again, with or without sudo):
python setup.py install
However, you will often need to manually download and install some prerequisites. Look for a requirements.txt file, and recursively download and install each thing on that list, then come back to this package.
Finally, at the end of all of this, you won't have any good record of what you installed, what versions you had, which packages were dependencies of other packages, etc. Upgrading to new versions, or migrating your environment to a different machine, will be a nightmare. And so on. All the stuff pip does for you, you don't get if you don't use pip. But if you really want to do it all manually, you can.

Related

Run a Python script on a host without Internet connection

I read all the proposed related questions but didn't find an answer to my case.
As for the title, I need to run a Python script (e.i. not an executable created with pyInstall) on a Windows VM that is not connected to the Internet. I can only download packages via browser.
Install Python is not a problem, but pip doesn't work, so I have the libraries issue.
Do you have any suggestions?
If you go to PyPi, where pip searches for packages, and find a package you are interested in, you can click on "Download Files" on the left panel. Using numpy as an example: https://pypi.org/project/numpy/#files
You can manually download the files that you want for each package and install them directly with pip. Keep in mind that the first couple of rounds will likely involve error messages telling you that there are missing dependencies. You will have to go back to PyPi and get those dependencies as well, until everything installs correctly.
You may want to check the following question for information regarding manual dependency management: How to extract dependencies from a PyPi package.

connecting python to Bloomberg

i am trying to connect my pycharm to my Bloomberg terminal. At my old company the infrastrcutre was already setup but not at this smaller company. I am using the link provided by bloomberg (https://www.bloomberg.com/professional/support/api-library/) but because of the security setup on my work pc I cannot pip install this (>> python -m pip install --index-url=https://bcms.bloomberg.com/pip/simple blpapi). Does anyone know how to
connect to bloomberg using baby steps
manually download these packages instead of pip install
where to save these packages to import them into the code
Thanks
Are you allowed to use virtualenv?
If you are you can just do:
virtualenv env
source env/bin/activate
pip install --index-url=https://bcms.bloomberg.com/pip/simple blpapi
That will then install it only to your local virtual environment.
If you're not, you also just open https://bcms.bloomberg.com/pip/simple/blpapi/ and download the libraries yourself, uncompress them, and put the files on the PYTHONPATH of your application.
I was interested in the question so thought I'd share what I found poking around.
Edit: Grab the wheel file from the site https://bcms.bloomberg.com/pip/simple/blpapi/ and try these ideas with help from this question: Install python wheel file without using pip
(Edit: the link was down when I looked, now it is up so grab the right one for your platform.)
Pycharm has a lot of tools to install things in a virtual env, if they block that at work, but let you install pycharm and python then things are a little messed up. Just sayin...
If you get into pycharm settings and go to project interpreter and then click add you can search bloomberg and there are 3 projects. You might see if those have any support. They do have email addresses you can contact the people. Those might be old and no good anymore or they might be better, who knows.
Hopefully these ideas give you a new lead somewhere.

Unable to install packages -- Pycharm -- Python.exec path not working

I am trying to install packages to use in a python program and am unable to install anything. Included below are screen shots showing the interpreter selected, the path of that interpreter, and the error message I receive. Please let me know what I am missing.
I've been looking around at other people's problems like this and nothing seems to fit my issue.
This kind of error seems like you do not have a stable connection to the pypi. The standard recommendation would be to "Make sure you are connected to the internet, Pycharm is allowed through the firewall and that your proxy (if you are behind one) allows access to this url address."
Now that is not very helpful so if this issue is happening over a single package, you can simply download the python wheel from the beautifulsoup's project page and install it manually by running pip install downloaded_whl_file.whl in the Pycharm's terminal (make sure that the environment is right!)
Lastly, you might be able to get around it by using a pip proxy through pip install beautifulsoup4 --proxy http://some-proxy.com
I hope that the above can help you get through your issue!

Can't find a way to install gettext from PIP virtualenv

Overall I'm trying to use a module in Django that helps with translating pages, but I don't have installed and can't do it through pip install package.
I've tried the fllowing:
pip install gettext
That returns that could not find a version that requires the...
I also downloaded the tar.gz file from the official website, yet when I try to install it localy the error:
python setup.py egg_info failed with error code 1 windows
Comes up. Been reading, trying to fix the second error or possible solutions, installed ez_update, updatade all packages, made a rollback and I don't know what to do anymore, any help?
The package gettext is available as python-gettext in Python pypi
Please use
pip install python-gettext
I was struggling with the same issue and what worked for me eventually is the following:
download gettext-runtime-0.17.zip and gettext-tools-0.17.zip (or the latest version) from here:
http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/
Place both directories in your project directory (say myProject)
Now, in each of these folders there is a bin folder. Go into it and copy the address. Each would look sth like:
C:\myProject\gettext-runtime-0.17\bin
C:\myProject\gettext-tools-0.17\bin
Go into: control panel > System > Advanced System settings > Environment variables. In system variables, choose Path and click
'edit'.
Paste both addresses at the end, like this:
;C:\myProject\gettext-runtime-0.17\bin;C:\myProject\gettext-tools-0.17\bin
(don't forget the semicolon after the last existing item)
Activate your virtualenv and run the makemessages command. It should work.

How can I display vcs revision of Python package installed with pip from vcs?

After installing some package with pip from vcs like this
pip install git+https://github.com/kennethreitz/requests.git#355b97165c#requests
how can I display the vcs revision/commit/branch/tag (355b97165c in this example) used to install it?
There's currently no way to do this because url used during installation is not being recorded anywhere. However there's work in progress to add such functionality. See Continuing Feature/record download info pull request.
I'd like to thank dstufft from #pip IRC channel for answering my question and pointing me to this pull request (which builds upon his pull request).

Categories