I'm trying to install a python package (specifically pandas) into Visual Studio code on a chromebook's linux virtual machine. I've tried many different things but none of them seem to work: trying to use pip install pandas results in bash: pip: command not found. I have no idea where the actual python interpreter is located, so I can't go to the source. I thought it was that I wasn't using the correct terminal, but the only other option is JavaScript Debug Terminal. What am I doing wrong? Is it even possible?
Pip is a python package management tool, which provides the functions of finding, downloading, installing and uninstalling Python packages. However, this tool is not included in the system and needs to be installed manually. Here is the official website of PIP, which contains installation instructions.
Related
I am on Linux Mint. When i try to import robot for robotframework in my python application it doesnt get recognized as a installed library. This while i checked the executable with the "which" command.
which python
Gives the output: /usr/bin/python
I put that path '/usr/bin/python' in the interpreter path in vscode. But it doesn't get
the installed libraries.
when i use the terminal outside of vscode and do
pip list
I get a big list with all of my installed libraries. But when i do the same in VScode i just get a short list with nothing of the installed libraries.
I tried to deinstall python, vscode and reinstall both but that doesn't work. The python path to the system python.exe is in the PATH variables. I dont know what i can try further.
It looks like that they both point to the same pip instance but it doesn't recognize the same packages. Like it cant find the site-packages folder
Can anyone please help?
I've found the problem.
In Linux Mint when you install visual studio code via the application manager built into the OS. It installs the flatpack version of Visual studio code. Which creates what looks like its own environment that cannot get the pip packages from the main system.
For me what solved it was to download the .deb version from the official vscode website(https://code.visualstudio.com/Download) and install that one using the:
sudo apt install /Downloads/{name of downloaded.deb file}
When I used this version of Visual studio code it all worked for me with no problem.
I just installed the new VS2017 Preview and imported a Python project. This project has many import statements but VS2017 does show error in some import packages like cv2, socketio, eventlet, eventlet.wsgi. This Python project runs fine, out of VS2017, in my Anaconda environment. Do I need to install OpenCV 2, socketio, etc in Windows? Or is there a solution like pip, anaconda, apt-get, in the VS2017 environment that can automate the installation of unresolved package?
I also noticed that it is possible to add Anaconda to VS project created. Can this Anaconda inside VS help to install the missing packages?
Regards.
You can, however it is not perfect.
Firstly you need to bring up the Python Environments menu which can be accessed by going:
Tools -> Python -> Python Environments
It should bring up a sidebar (depending on how you have VS setup). There should be a dropdown box about half way down with the text "Overview". Click on that and you can select "Packages". This will bring up a textbox under it that will allow you to use standard pip commands to install packages.
If you are on Windows though there is one added step for some packages though. As pip does not work well on Windows, due to the fact that the standard Windows package site (PyPI) does not yet have Windows wheels for a lot of common packages.
Therefore, you are best off going to Christoph Gohlke's unofficial package site and then downloading the package you need. Once it's downloaded locally just copy and paste the LOCAL address into the textbox under "Packages". It will then install the package and you'll be good to go.
I had same problem and i could get it working with visual studio 2017 python v3.6 using following instructions
Install appropriate .whl file using this link
(cpMN where you have Python M.N). contrib includes OpenCV-extra packages. For example, assuming you have Python 3.6, you might download **opencv_python-3.2.0+contrib-cp36-none-win_amd64.whl**
link to download
Then install it by running this command from installed folder
pip install opencv_python-3*win_amd64.whl
I just installed the new VS2017 Preview and imported a Python project. This project has many import statements but VS2017 does show error in some import packages like cv2, socketio, eventlet, eventlet.wsgi. This Python project runs fine, out of VS2017, in my Anaconda environment. Do I need to install OpenCV 2, socketio, etc in Windows? Or is there a solution like pip, anaconda, apt-get, in the VS2017 environment that can automate the installation of unresolved package?
I also noticed that it is possible to add Anaconda to VS project created. Can this Anaconda inside VS help to install the missing packages?
Regards.
You can, however it is not perfect.
Firstly you need to bring up the Python Environments menu which can be accessed by going:
Tools -> Python -> Python Environments
It should bring up a sidebar (depending on how you have VS setup). There should be a dropdown box about half way down with the text "Overview". Click on that and you can select "Packages". This will bring up a textbox under it that will allow you to use standard pip commands to install packages.
If you are on Windows though there is one added step for some packages though. As pip does not work well on Windows, due to the fact that the standard Windows package site (PyPI) does not yet have Windows wheels for a lot of common packages.
Therefore, you are best off going to Christoph Gohlke's unofficial package site and then downloading the package you need. Once it's downloaded locally just copy and paste the LOCAL address into the textbox under "Packages". It will then install the package and you'll be good to go.
I had same problem and i could get it working with visual studio 2017 python v3.6 using following instructions
Install appropriate .whl file using this link
(cpMN where you have Python M.N). contrib includes OpenCV-extra packages. For example, assuming you have Python 3.6, you might download **opencv_python-3.2.0+contrib-cp36-none-win_amd64.whl**
link to download
Then install it by running this command from installed folder
pip install opencv_python-3*win_amd64.whl
I am using Python 2.7.11 and am trying to pip install modules however a few of them are failing. The message I get is "Failure to build wheel for 'X'" and "Error: INCLUDE Environment Variable is empty".
I tried to install Scrapy, LXML and Twisted and those failed. Some other random modules I tried installed fine.
I have installed pyOpenSSL, added python27 and python27/scripts to environment.
Thanks,
I tried both the solutions offered, none worked.
I installed Microsoft Visual C++ Compiler for Python 2.7, download it here. Then run:
pip install scrapy
That worked for me
A quick solution is to install the pre-compiled version of lxml. You can find it here. If you use the .exe you can point it directly to your python root folder.
After that:
close and re-open cmd
pip install your_package (make sure cmd is in the correct directory)
enjoy having no frustrating lxml errors!
Hope this helped.
Use a pre built library from this link if you are on windows:
https://www.lfd.uci.edu/~gohlke/pythonlibs/
Choose the relevant library given python version and desktop config. For example
I want to install apell in python 3.6 and winamd64 then download this:
aspell_python-1.15-cp36-cp36m-win_amd64.whl
Now go to your console and type
pip install path-to-.whl
and that's it.
I am trying to install the fitsio package to python. I have tried so using pip, but that resulted in the following error: "ValueError: could not configure cfitsio 3370". I have also tried to install it without pip, but it gave me the same error. Any advise on how to install it properly? I don't have a lot of python experience, so please keep it simple. Thanks!
According to the setup.py source code of the python fitsio package, the package is configured and compiled using os.system('sh ./configure') (line 40) and os.system('make') (line 47) respectively. This is expected since the python fitsio package is basically a python wrapper of the C version of the fitsio library.
These are Linux commands, which you are trying to run natively at the Windows Command Prompt. This can't work and that's why you get the errors you're getting.
To get the python fitsio package installed on Windows you need to use something like Cygwin. Be sure to include the make and gcc in the packages you install in Cygwin (they are usually installed by default), as the fitsio package you want requires a GNU Toolchain for compiling the cfitsio. Another option would be to switch to Linux or use a Linux virtual machine but that's going a long way just to get a library to work :)
After installing the package you can find some examples for the fitsio module in python at the github repository landing page of the package.