Currently trying to get python up and working on my work laptop which has proven to be a huge pain in the you know what.
It seems like the PATHing is all screwed up even with pip installing packages. For example, I tried to install seaborn today via pip install seaborn which ran successfully but when I try to import it on Visual Studio it has the yellow squiggly underneath it. I try to reinstall it but it says it has already been satisfied.
Is there anyway to manually re-route all of my python libraries to where I actually know whats going on? I have the PATH set to the correct library in environment variables but it still does not read that I have seaborn installed.
Any help is greatly appreciated.
You can create python virtual environment and install your libraries on it.
https://linuxize.com/post/how-to-create-python-virtual-environments-on-ubuntu-18-04/
It creates a isolated area for your specific project.
It sounds like you might have different python installations on your system.
If that's the case it might also be the case that the python you are using in visual studio isn't the python that is packages are being installed for via a straight forward pip command.
You could try to instead of pip install ... call python -m pip install .... That ensures that you are using the pip of the python installation
I recommend you to install all dependencies (seaborn, pandas, numpy, matplotlib, etc) in a virtual environment, that means that you can have its own independent set of installed Python packages in its environment.
See here the python documentation on how to work with virtual environments on different OS.
Also, check which python versions you have installed on your machine. If you have both python2 and python3, use pip3 and python3 on terminal whenever you want to install or run something.
Related
Right now I'm trying to install python (3.10) and all further installations on my new pc (windows 10) and so far everything is set up:
Python installed
Windows paths for "Python" & "Python\Scrips"
I am able to call the python and pip version and also install some packages. But after installing virtualenv and creating one the - at the moment - unfixable error appears: I am unable to install packages into the pip-path of the virtualenviroment itself. Whenever I'm trying to run any pip-command I'm getting the following error:
Unable to create process using 'C:\Users\ExampleUser\AppData\Local\Programs\Python\Python310\python.exe "C:\folder\env\Scripts\pip.exe" '
As you can see, it's always refering to the original python-path, but on the other hand it's refering to the pip-path of the virtualenv!? Don't know if it's helpful, but when typing in where python and where pip the paths inside the venv are the first one listed. I've also watched out for no blank spaces in my path...
Unfortunately no explanation out there could help me until now and I never faced this problem on my old machine - mostly the same, except some older version of python, pip and virtualenv.
Does anyone else has an idea what I am missing?
downloading Python 3 at the official website and installing it via express installation
Copy & Paste the standalone python into the /python folder and overwriting the python version
running python -m pip install --upgrade pip in cmd
Now pip and python 3 are installed in their latest version.
It's work for me
Could you use venv to create your virtual environment, instead of virtualenv (given that venv is the recommended way to create virtual environments for Python 3.3, and newer)?
If using venv is an option, this procedure may give you some idea on how to do it.
I have not done any Python development on Windows, but I think the basics would be:
python3 -m venv your-env-directory
your-env-directory\Scripts\activate.bat
If using venv is not an option, maybe you can try specifying the -v flag when running your virtualenv command to increase verbosity so you can further troubleshoot what's going on.
try upgrade pip version python -m pip install --upgrade pip
[ Sorry if this answer turns out to be more of a comment than an answer. I only have 21 reputation, so I cannot comment ]
When trying to install pip packages and run python files, is the CWD (Current Working Directory) C:\folder\env\Scripts? If so, try chaning your CWD to C:\folder. I had a similar problem and doing this fixed it.
You may need to look into a cygwin environment, and look into a chroot or jail environment to run the application without conflict.
Have you tried to use virtualenv-wrapper-win module.
It helps me a lot to manage virtual envs
Life is much easier using Anaconda 3 (it's definitely bloated compared to normal Python though), or use the minimal Miniconda (barebone install, basically just Python + a package manager). You can download it here: https://docs.conda.io/en/latest/miniconda.html#windows-installers
Then you can make a new virtual environment super easy:
conda create -n myenv pip
conda activate
If you have multiple environments you do: conda activate [environment_name]
Now you're in your new environment with pip installed. And you get drop down menus in the Windows menu to get to your new environment too, so there isn't any searching required. They just appear. Now if you want to link Jupyter Notebook or Spyder to the installation, it takes more steps since you need more packages. I used this guide which basically activates Jupyter first, then Spyder IDE. https://medium.com/#apremgeorge/using-conda-python-environments-with-spyder-ide-and-jupyter-notebooks-in-windows-4e0a905aaac5
Since you created the environment with pip added you can pip install whatever packages you need. I had to do this recently with OpenBLAS backed NumPy and SciPy (the defaults from pip, not from conda). Now Miniconda is the closest thing to basic Python installation, and comes with some nice tools to make your life easier. Hopefully this is helpful.
I have already used pip install pysimplegui, using pip list shows that it is installed in Terminal (I use a mac). I also made sure it was the most recent version of pysimplegui.
I'm newer to coding some I'm not sure what other information to put here. Any advice would be enormously helpful. I am using Jupyter Notebook through Anaconda.
I should add that before this I tried doing the same thing with easygui and had the exact same error.
In the anaconda terminal use python -m pip install PySimpleGUI so you install it in the python being used.
Mixing pip install and conda install is not to recommend, although sometimes unavoidable. What has happened in your case is not related to this conflict, though. In this case, the wrong pip was invoked when installing the package, so it was installed for a different python interpreter than the one you're using to run the notebook. You can have several python versions installed globally, both python(2) and python3. Furthermore, you may have even more versions of python in virtual environments, so you need to pay attention to which version you want to install a package for.
In case you don't have any specific reason not to, you'll save yourself some future headaches by using the conda package management system over pip to avoid those situations where they don't play nice with each other and you end up with a broken or unpredictable package setup.
Note that I'm not saying conda is better than pip in any way, I'm only proposing going with conda since you're using the Anaconda environment and its preinstalled packages already.
copy from PySimpleGUI
https://pysimplegui.readthedocs.io/en/latest/
Warning - tkinter + Python 3.7.3 and later, including 3.8 has problems
The version of tkinter that is being supplied with the 3.7.3 and later versions of Python is known to have a problem with table colors. Basically, they don't work. As a result, if you want to use the plain PySimpleGUI running on tkinter, you should be using 3.7.2 or less. 3.6 is the version PySimpleGUI has chosen as the recommended version for most users.
I am relatively new to Python and I was told to use Anaconda and create a virtual environment (as I am mainly using pytorch for neural networks). But I start losing track about all my libraries.
First of all, I am sometimes not sure, how to install a library - should I use conda install (if so, I have difficulties finding the exact command) or should I use pip install. Also there is a difference between pip3 install and pip install, but for some applications it matters and for others it doesn't. I also start getting conflicts between packages and I don't know how to fix it.
In short: Do you guys have ideas for efficiently organizing your libraries with or without Anaconda? I am happy for any advice.
if you want to see what library and modules you are using you can check it with pip3 if you are using python3 and pip if you are using python2. so pip3 freeze gives you a list of installed libraries and also pip3 list. is giving you installed modules.
but for organize your library and modules. i recommend you install virtualenv on desktop and then you can install Django near that folder in desktop so you will control all your modules easily and when you will upload it on sever you will upload with all modules what you need.
I am new at Python and Ubuntu. I really struggle to decide the best way of installing Python packages on Ubuntu. I am using VIM so I cannot use Anaconda since they do no "talk".
I have two options:
Install with: pip3 install --user foo. This works find but according to python4astronomers you should never use --user. It will work very bad.
Use apt-get but then I got old packages
Use sudo pip, but that can get bad code into my system.
I do not want to use virtual environments. I want to be able to use all packages I have installed when I use Python. I normally use Jupyter.
I find it strange that Python installation is so difficult on Linux compared with Windows.
Which of these is the correct way?
I have recently begun having troubles using pip to install python packages. I have always used pip but never really understood how it actually works, my experience with it is basically limited to "pip install pkg".
Recently when trying to install openCV on my machine, I followed a few guides that involved changing paths etc. Since making these changes I have been having trouble using pip to install packages correctly.
Now when I run "pip3 install pkg", the install runs fine without any errors. When I try to import the module in python however, python cannot find the package. If I run "pip3 list" in the terminal I get a list of modules that is different to running help('modules') within python.
I think pip is installing the packages to a different location than my version of python is referencing when importing modules?
Is there a way I can change where pip installs to? What did it mean to change paths and how can I avoid this in the future?
Thanks in advance.
EDIT: I should mention that running "python3 -m pip install pkg" installs the packages correctly.
Because you have 2 versions of python installed, the best solution is to install and use virtualenv
A Virtual Environment is a tool to keep all dependencies required by different projects and python versions in separate places. It solves the problem you mentioned and keeps your site-packages directory manageable.