I recently formatted my hard drive and got rid of Windows and went to Linux. I had a program that used to work fine before the reformat but isn't working fine now.
I believe it was written for 3.4 and not 2.7 since I used import tkinter and not import Tkinter. In either case the program won't run now that I have made the switch over. In 2.7 it does nothing...it acts like it has run through the code and then stops and gives me back the cursor when it should be popping up a t/Tkinter window displaying a graph. In 3.4 I get the error saying numpy isn't installed.
When I apt-cache policy python-numpy it comes up showing it 1:1.8.2 is installed. When I do the same for scipy it shows 0.13.3 is installed. Seeing from other websites when I check for cython it shows 0.20.1+git90-gee6e38e is installed. When I check for tk it comes up 8.6.0 is installed.
I'm a bit lost. Why I do get the error code saying numpy isn't found when I got to run the program yet it is installed. What do I have to do to get this program back up and running again.
I think you have the librairies installed for Python 2... Did you use pip to install the librairies ?
Try :
pip3 install numpy
And same for your other librairies.
If you use Ubuntu then you have 2 versions of python executables - python and python3. So I think you need to install dependencies for python3 version by sudo pip3 install numpy or sudo apt-get install python3-numpy if it exists in repos.
Related
I tried to install the pyqt5 package für python 3.9 on Mac.
Since it didn't work via pip3 I installed it via Homebrew
% brew install pyqt5
and it seemed to work since the terminal says, if I try
pip3 install pyqt5
the requirements are already satisfied.
Yet, if I start PyCharm to to write and test my program it can't find the libraries etc.
What do I have to do?
I just tried to brew install pyqt5 on my Mac. brew then installed a new Python 3.9 interpreter (this is viewed as a dependency of pyqt5).
I suspect the same has happened on your system: brew has installed a whole new Python interpreter, and now when you type pip3 at the command line, you're finding the version of pip installed by brew, which is telling you that pyqt5 has been installed.
However, each Python installation on your system as its own set of packages. Your new Python interpreter has pyqt5 installed, but your original Python interpreter still doesn't.
I suspect that PyCharm is configured to use your default (original) Python interpreter, which doesn't have pyqt5 installed.
Try executing the following at your command prompt (terminal): which pip3. If you're shown a path /usr/local/Cellar/... then this confirms that when you type pip3 at the command line you're actually referring to the version of pip corresponding to a Python interpreter installed by brew.
OK, so what to do going forward?
Two options:
Work with this new Python installation. Then, you'll need to install all of the packages in your previous version of Python again (e.g. just because you had Numpy installed on your original Python installation doesn't mean you'll have it installed by default for your new Python interpreter). Further, you'll have to configure Pycharm to use this Python installation. I don't know the exact steps for this, but go to the Preferences tab and look for something along the lines of 'Python Interpreter' underneath 'Project Settings'.
Remove the new Python installation, figure out what's up with pip, install your desired package.
I'd go with 2). It can get messy to have multiple different versions of Python on your system, unless they're managed by an environment manager such as conda.
To that end, what went wrong when you first tried to install pyqt5?
I have Python27 installed in Windows 7
I am trying to build a reddit bot using this tutorial
I found instructions on how to install pip for windows from here
The page says that after installing pip, I can use pip freeze to check if the installation went correctly
It says pip freeze should display some information as shown below
Microsoft Windows [Version 6.2.9200] (c) 2012 Microsoft Corporation.
All rights reserved.
C:\Users\Username>cd c:\Python27\Scripts
c:\Python27\Scripts>pip freeze
antiorm==1.1.1
enum34==1.0
requests==2.3.0 virtualenv==1.11.6
However pip freeze doesn't show me anything at all
Did pip install correctly, or is there any problem? Is there any other way i can test proper installation?
If you want to test it thoroughly, you can use your actual pip installation to install something. For example, numpy would be a good sized example that can rule many problems out.
> pip install numpy
Now, run pip freeze again to check if pip is working as expected. It should then have something to show.
If you want to test it even further, you can open a terminal and
> python
> import numpy
That should be the complete test of your pip installation.
Additionally, whenever I install a new tool in my stack, I like to validate its path with where <executable name> (on Windows) and which <executable name> (on Linux). There are some compilers like Java that are always conflicting with other installations (like crazy, to the point that a complex setup may sometimes have to inject an absolute path to enforce the use of the correct version).
Also, asking the executable for its version can rule many other problems out. In your case, you can use pip --version to check which version you got and compare it to the stable or latest, according to what you want to use.
windows is a confusing piece of software if your coming from a Linux background... the solution that worked for me is the following
pip list
The problem you are facing is that if you only have de default packages in your installation lets say pip, wheel, pip freeze does not have anything to freeze at the moment so that's why dont show anything. try to install a new package then run the command again.
I am having following attached error as screen shot while installing pip install softlayer for windows 7 Laptop.
Please see the attached screen shot.
Unfortunately this is a unknown issue (not reproducible, I'm using python 2.7.12), there is no any report about this:
https://github.com/softlayer/softlayer-python/issues
As Harald's suggestion you can test:
Installing another packages
Try with another python version
If the issue is still reproducible, try to provide more information about the pip and python versions that you have installed (pip --version and python --version). Also if you have another additional libraries installed (pip list), in order to discard that one of them is causing a conflict.
I am having trouble with PIP right now. When I installed python, I check the box to install pip together. Python itself works fine, but PIP does not work. Whenever I type pip in command line on Windows (no matter 8.1 or 10, I just fallback and re-upgrade my laptop), it will do nothing but keep freezing at this point and even ctrl-C is not working.
What should I do to solve this problem? I've tired to resintall python on 2.7.9, 2.7.10, 3.4.3, 3.5, they all have same problem, it seems not the python but some dll is missing(I guess).
What it looks like when freezing
What it looks like when calling with -v and install package('Django')
Try python -m pip install Django. I had the same problem with pip today and it worked for me.
Check out the log file created by the pip whenever you invoke the pip command. The log file is situated generally at
C:\Users\user_name\pip
The notepad file will be created and you can verify what is missing
Okay so I tried to install matplotlib and python earlier from the command line. Turns out i probably already had python installed but it was not make(ing) plots. Then that didn't work so i tried to, from the software center install matplotlib. So my software center says it is installed. However, when i am in python it still can not find matplotlib. Also when i am not in python and try to run commands like
python setup.py clean
It says python cannot find setup.py
This has been going on for hours and i am a beginner linux user and it is horrible
From the command line you can install matplotlib as follows:
$ sudo apt-get install python-matplotlib
Once it's installed you can access it from inside python like this:
>>> import matplotlib
>>> help(matplotlib)
If you want more control over the version of python you're using, I recommend using Anaconda. Very easy to install and use.
If you want even more control you can build from source. That post is specifically about setting up IPython but the python build step are the same.