How can i solve the following problem with pip?[Could not install packages due to an OSError] - python

My virtual environment is accidentally not working. i found out this message when i tried to add new package to my virtual environment My problem is as following:
I've run this command.[$ pip install <package_name>]
But i met an error message.
ERROR: Could not install packages due to an OSError: Missing dependencies for SOCKS support.
How can i fix the error? I need detailed information.
what did i try?
1.upgrade my pip version.
2.create new VENV(for python project).
How can i fix the error? pls, I need detailed information.

Try writing "pip3 install <package_name>"
Sometimes depending on what compiler or OS you are using there could be differences in installing packages. I had the same problem a while ago and writing "pip3" instead of just "pip" fixed the problem for me.
However, from the error code you're getting, that may not be the case. I assume you are on ubuntu so I would suggest running
$ env | grep -i proxy
then
$ unset socks_proxy

Related

Python: Showing unmet dependencies error and broken packages error despite not having any such packages

We were trying to run a shell script for installing prerequistes(install_prerequistes_onnx.sh) for OpenVINO Model Optimizer but we got the following error:
The Error
We tried resolving it using python 3.6.7 in a virtual environment(tsc). But it was of no use. Also we do not have any broken packages(we checked for them explicitly) but it still shows "unable to correct problems, you have held broken packages".
Can anyone explain the last three lines of the error? Also what does "error in line 78" imply, since our notebook was running fine before incorporating OpenVINO.
PS: We are using Ubuntu 18.04.
Please ensure that you’ve installed external software dependencies.
You may refer to this link for the installation:
https://docs.openvinotoolkit.org/2021.3/openvino_docs_install_guides_installing_openvino_linux.html#install-external-dependencies
For your virtual environment, the broken packages error that you’re facing is due to the Python’s dependency package version is not available on your system.
Try with this command: sudo apt update && sudo apt upgrade
If the issue still persists, you may need to re-install Python.

VSCodium - can't configure Python support

I'm using VSCodium and I can't install any kind of Python support.
I have Python installed on my OS (5.6.15-arch1-1), available in $PATH.
When I follow the guide I can't install the plugin and get IntelliSense/whatever working.
code --version
1.46.1
cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
x64
How to install plugins in order to have Python3 support in this IDE?
You could check that your VSCodium has successfully installed Python extensions.
I reproduced the problem you described, and after installing the python extension, the problem is solved.
The problem was with Python extension like Jill Cheng said, but couldn't install it due errors.
code --install-extension ms-python.python
It failed due weird error:
Installing extensions...Cannot read property 'length' of null
What I did:
Update vscodium (yay -Sy vscodium-bin in my case)
sudo chown -R $(whoami) ~/.vscode-oss
Suddenly it worked when installing from GUI again - previously nothing was happening
I assume update fixed something deep inside VSCodium, since chown didnt change any ownership in config folder.

installed pip package not found

I was just given a new mac and after installing pip and lcc through pip I get a command not found error when running lcc run.
When running help("modules") inside of python I can see the lcc package there.
the same goes for pip freeze
pip freeze | grep lemon
lemoncheesecake==0.15.2
I'm running out of ideas.....
maybe I messed up the pip installation because I did it first with:
python get-pip.py
and then with
sudo easy_install pip
how do I fix this?
this is my echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Thanks
From what you're saying it seems that your python installation is not quite right, and Mac's version of python is also not quite right by default, you can read more about it here: http://docs.python-guide.org/en/latest/starting/install/osx/#doing-it-right
Also, I would highly advise that when you get a brand new Mac and plan to do some development work as a rule of thumb follow these steps:
Install xcode
Install Homebrew
Then you can install anything else you want.
I think the problem is due to the fact you have more than one version of python installed. Package installed by pip are visible to one version, but not to the other. I think this issue is quite common, and has already been answered (for example) here:
Too many different Python versions on my system and causing problems
To check that this is the case:
pip show Icc
should tell you where Icc was installed.
import sys
print sys.path
should tell where python looks for modules.

Use pip with non-standard Python installation (non-root installation)?

I'm trying to get up and running with Python 3.5.2 and various packages on a server I work on, but don't have root privileges for. I installed Python to my home, and that seems to be working. I'm trying to set it up so I can install packages to that Python installation (ie ~/lib/python3.5/site-packages) via pip, but I cannot get it working.
Even after adding ~/lib/python3.5/site-packages to $PYTHONPATH, no luck.
Running pip install pandas, I get the error /usr/local/bin/python3.5: bad interpreter: No such file or directory , so it's still looking in the wrong spot. It should be looking at ~/bin/python3.5. Setting an --install-option="--prefix= argument doesn't change the problem.
Is this possible to do?
Try this:
pip3 install --user "library name"

Version error after pip installing MySQL-python on OSX

I have successfully installed MySQL-python to my virtual environment, confirmed by the fact that PyCharm can import it. I am however getting this message:
ImportError: this is MySQLdb version (1, 2, 4, 'beta', 4), but _mysql is version (1, 2, 5, 'final', 1)
My installation method has been:
Activate my venv in the terminal
export PATH=$PATH:/usr/local/mysql/bin
export CFLAGS=-Qunused-arguments export CPPFLAGS=-Qunused-arguments
pip install MySQL-python
Which returns a successful build. I really don't understand what the problem is, is pip serving me a corrupted directory?
I tried resolving this by googling and the likes to no avail. I then tried downloading version 1.2.4b4 from sourceforge and built it within the venv. This gives me the following error:
ld: warning: ignoring file /usr/local/Cellar/mysql/5.6.19/lib/libmysqlclient_r.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/Cellar/mysql/5.6.19/lib/libmysqlclient_r.dylib
I have run file $(which ) on mysql and python, returning a 64 bit build for mysql and both a 32 and 64 bit build for python.
I really have no idea what to do next, I would really appreciate some help, let me know if I've missed something! Thank you
EDIT:
I pip uninstalled MySQL-python and tried again with this zip: https://pypi.python.org/pypi/MySQL-python/1.2.5
pip install -Iv https://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.5.zip#md5=654f75b302db6ed8dc5a898c625e030c
Which gave me the same error as before, stating MySQLdb is version 1.2.4b4 but _mysql is 1.2.5. This leads me to believe I might have a lingering version of MySQL-python that isn't being uninstalled. How would I go about testing this? Thanks!
A couple of common potential issues:
make sure your path is right and that pip and python refer to the same interpreter. Virtual environments are best activated by doing source activate <NAME> or prepending them to the path instead of appending.
I had multiple issues with MySqlSB and stack overflow is full of questions about it. All my problems went away when I switched to pymysql, whose API is fully compatible with mysqldb. Even better, there is a method install_as_MySQLdb() which makes pymysql appear exactly like mysqldb, so all packages the expect the latter work with the former.
The procedure that I use to get set up on OSX is:
get rid of all Python installations (system python, home-brew, etc)
brew install mysql gcc. gcc is in case you want to compile c/fortran extensions to python modules.
Watch for permission errors- always run brew doctor
install anaconda
set up a virtual environment conda create -n <NAME> python=3.4
activate virtual environment source activate <NAME>
install required packages, trying conda first and pip if the package isn't there. For example, I always do conda install numpy so I don't have to compile it myself, and I do pip install pymysql
Thanks for the above answer, good advice for future troubleshooters. I managed to solve this by re-installing the 1.2.5 build and restarting my compiler.
In other words, the method I outlined above should work. For future reference make sure your bin/activate and bin/pip have their paths set to your venv and not someone else on your developer team

Categories

Resources