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

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!

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.

Python module installation

we are unable to install new python modules to my computer using pip
installation error on pycharm
Installation error on cmd
This is just a downloading problem. You should check your internet connection.
You should either try later or through a different network (in case the access to the website is blocked on your current network.) You might also try to use a VPN.
P.S.: I've just tried to install scrapy via pip, and I didn't encounter any problem.

How to install request library for python27

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.

Unable to use downloaded third-party library from within PyCharm

I'm working on a script that will plot data onto a map using the Basemap library. I'm trying to import Shapely as well for use in this same script. I'm working with Anaconda2 for Python2.7 in a Windows 7 environment. I used conda install to download the tar.bz2 file from the Conda Packages site (using Windows command line) and it looked like it all installed correctly.
When I open Pycharm and look at my accessible site-packages, I can see this package. However, when I try to use it within my script, I get an error saying that the package does not exist. I ran the script through the debugger to see if it would shed any more light, but I got the same error. Here's a screenshot of my available site packages when I go to Settings-->Project Interpreter from within Pycharm.
Screenshot of PyCharm site packages available
Is there something special I need to do in order to access this package from within a fresh Python file? I was trying to say "import shapely" or "import osx-64-shapely", but both give me the same "package does not exist" error message. I've been able to successfully use other third-party libraries within Python, so I'm not quite sure what the error is here....
I'm new to SO - if you need more details or there's some piece of info I didn't include, please let me know. Thank you for your help!
EDIT: I am NOT asking what the difference is between conda and pip, or how to use pip within PyCharm. I have used both successfully before to install third-party libraries. What I am asking is what might cause a third-party library that appears to have installed successfully from the command line become inaccessible from within PyCharm when I attempt to import it.
I'm not familiar with Shapely but I was astonished to see the name osx-64-shapely as a site-package for your python installation which is in windows 7. Are you sure you downloaded the right file? :)

Categories