Yes, I already read that question but it didn't help me.
C:\Users\*\Documents\git-workspace\redditCountdownGui>"C:\Program Files\WPy64-3741\python-3.7.4.amd64\Scripts\pyinstaller.exe"
C:\Users\*\Documents\git-workspace\redditCountdownGui>
I tried using this method:
C:\Users\*\Documents\git-workspace\redditCountdownGui>"C:\Program Files\WPy64-3741\python-3.7.4.amd64\python.exe" -m pyinstaller
C:\Program Files\WPy64-3741\python-3.7.4.amd64\python.exe: No module named pyinstaller
C:\Users\*\Documents\git-workspace\redditCountdownGui>
I can't get it to work. It's also not working for pip:
C:\Users\*\Documents\git-workspace\redditCountdownGui>"C:\Program Files\WPy64-3741\python-3.7.4.amd64\Scripts\pip.exe"
C:\Users\*\Documents\git-workspace\redditCountdownGui>"C:\Program Files\WPy64-3741\python-3.7.4.amd64\Scripts\pip3.exe"
C:\Users\*\Documents\git-workspace\redditCountdownGui>
I also tried adding to PATH but then it's the same - no output at all.
Can anyone help me?
When using WinPython, you need to start WinPython Command Prompt to get all Paths set correctly. Within that shell, you can use pip as usual:
D:\WPy64-3740\scripts>python
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.executable
'D:\\WPy64-3740\\python-3.7.4.amd64\\python.exe'
>>> exit()
D:\WPy64-3740\scripts>python -m pip install requests
Requirement already satisfied: requests in d:\wpy64-3740\python-3.7.4.amd64\lib\site-packages (2.22.0)
Requirement already satisfied: certifi in d:\wpy64-3740\python-3.7.4.amd64\lib\site-packages (from requests) (2019.6.16)
Requirement already satisfied: urllib3 in d:\wpy64-3740\python-3.7.4.amd64\lib\site-packages (from requests) (1.25.3)
Requirement already satisfied: chardet in d:\wpy64-3740\python-3.7.4.amd64\lib\site-packages (from requests) (3.0.4)
Requirement already satisfied: idna in d:\wpy64-3740\python-3.7.4.amd64\lib\site-packages (from requests) (2.8)
D:\WPy64-3740\scripts>
I know it's a lazy answer, but this is Windoze. You should simply uninstall and reinstall Python.
During the install, the python executable should get added to the paths correctly ...although (depending on installer) you may need to specifically select a checkbox to add it to the system paths. It should also install pip, although (again) you may need to specifically select that in a checkbox during install.
After (proper) installation, you should be able to open a cmd window, and simply type python and be dropped into the Python working environment. You should also be able to just type pip and find the working copy of pip.
If you can't do this, your Windows environment has gotten screwed up :/
Please note, if you have more than one version of Python installed, you may need to type python3 / pip3 to access the correct version.
The error message No module named pyinstaller is because the Python can't find your site-packages. This is also a result of your paths being screwed up when you're calling python.
Try running the command python -m site to see where your site-packages is installed, ensure it is in your paths, and ensure that the module in question is installed there.
Different versions of Python have their own paths for site-packages. So installing a module for Python 2.7 does not install it for Python 3.x
Related
Hi Guys I've been searching for more than two hours by now. I searched all over SOF and Youtube but found no answer.
I Have anaconda installed and as they said on the installing instructions pandas and other diferente pakgs are included already, but when I try to import pandas as pd on Jupyer or VS I get the module not found error.
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-2-7dd3504c366f> in <module>
----> 1 import pandas as pd
ModuleNotFoundError: No module named 'pandas'*
I only have python 3.8 installed no other versions. And I've confirmed several times that pandas is installed.
SHOW PANDAS AT TERMINAL
(base) Rogers-MBP:~ rogerrendon$ pip show pandas
Name: pandas
Version: 1.0.5
Summary: Powerful data structures for data analysis, time series, and statistics
Home-page: https://pandas.pydata.org
Author: None
Author-email: None
License: BSD
Location: /Users/rogerrendon/opt/anaconda3/lib/python3.8/site-packages
Requires: python-dateutil, numpy, pytz
Required-by: statsmodels, seaborn
PYTHON VERSION
(base) Rogers-MBP:~ rogerrendon$ python
Python 3.8.3 (default, Jul 2 2020, 11:26:31)
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
PIP3 INSTALL CHECK
pip3 install pandas
Requirement already satisfied: pandas in ./opt/anaconda3/lib/python3.8/site-packages (1.0.5)
Requirement already satisfied: python-dateutil>=2.6.1 in ./opt/anaconda3/lib/python3.8/site-packages (from pandas) (2.8.1)
Requirement already satisfied: pytz>=2017.2 in ./opt/anaconda3/lib/python3.8/site-packages (from pandas) (2020.1)
Requirement already satisfied: numpy>=1.13.3 in ./opt/anaconda3/lib/python3.8/site-packages (from pandas) (1.18.5)
Requirement already satisfied: six>=1.5 in ./opt/anaconda3/lib/python3.8/site-packages (from python-dateutil>=2.6.1->pandas) (1.15.0)
Can please somebody help me? I'm loosing my mind hahah
You are using the built-in python from apple instead of Anaconda. During installation there is supposed to be a prompt that asks you something to the effect of "do you want anaconda to be your default python installation". If this didn't come up or you clicked past it too fast, it will not have made any changes to your bash profile (zsh on catalina) that would make your system aware of the new python installation. Some things (like pip) may use other ways to discover the correct distribution to target which is why that seems to find anaconda just fine.
If you open up your user folder and make hidden files visible (cmd shift period), you should find either bash or zsh profile files that control the startup of any system shell you call. If you don't find somewhere in those files a block put in there by the installer (it should be very clear from the comments), then effectively anaconda was installed, but never activated. Try opening a command prompt and calling:
(base) Rogers-MBP:~ rogerrendon$ source /Users/rogerrendon/opt/anaconda3/bin/activate
then if you are running 10.14 or earlier:
(base) Rogers-MBP:~ rogerrendon$ conda init
or if you have Catalina (10.15)
(base) Rogers-MBP:~ rogerrendon$ conda init zsh
I have dealt with similar issues in the past. The first thing to check is to make sure that you don't have multiple python versions installed throughout your computer (unless you require this). If you properly installed anaconda then you should have python within that environment. To uninstall other pythons, go to your uninstall apps page and find the python versions if they exist and remove them.
If after doing this an issue still arises, restart and check your path. Make sure you have paths to ...\anaconda3\Library\usr\bin, ...\anaconda3\Library\bin, and ...\anaconda3\Scripts
Another thing to try is conda installing pandas although anaconda should include this package already.
I've found an issue using hydrogen within Atom (basically allows jupyter to be used in Atom) where the atom search paths set from install are to the wrong package locations. Fixing this could become cumbersome so I would recommend the nuclear option of uninstalling everything and reinstalling if nothing above works.
Go to File->Setting->Project Interpreter->click on plus sign->type 'pandas'->Install Package.
This question already has answers here:
Install Beautiful Soup using pip [duplicate]
(4 answers)
Closed 8 months ago.
I'm trying to get BeautifulSoup4 set up so that I can run the following:
from bs4 import BeautifulSoup
However, when I go to install BeautifulSoup4, I get the following:
Defaulting to user installation because normal site-packages is not writeable.
Requirement already satisfied: beautifulsoup4 in ./Library/Python/2.7/lib/python/site-packages (4.8.2)
Requirement already satisfied: soupsieve>=1.2 in ./Library/Python/2.7/lib/python/site-packages (from beautifulsoup4) (1.9.5)
Requirement already satisfied: backports.functools-lru-cache; python_version < "3" in ./Library/Python/2.7/lib/python/site-packages (from soupsieve>=1.2->beautifulsoup4) (1.6.1)
$ from bs4 import BeautifulSoup4
from: can't read /var/mail/bs4
When running in Python3 I get this error
Python 3.8.2
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from bs4 import beautifulsoup4
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'beautifulsoup4' from 'bs4' (/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/bs4/__init__.py)
I have both Python 3 and Python 2.7 on my computer, but can't figure out how to get it to recognize bs4
Appreciate the advice!
Having multiple versions of Python on a system can lead to confusion, and it's a problem every python developer encounters at some point.
To address your question, try installing bs4 using the python -m command, for example python -m pip install beautifulsoup4. This ensures that pip will install the package to the python you called.
It also sounds like it is time to learn about virtual environments. Virtual environments allow you to seperate instances of python for each of your projects, so you don't get conflicts between packages.
If you would like more information on installing BeautifulSoup4 with multiple versions of python check out this question.
OS (Linux): Ubuntu 14.04.4 LTS (Trusty Tahr)
For some reason, my Python 3.5.2 is looking into the Python 2.7 packages directory instead of its own:
] python3 -m ensurepip
Ignoring indexes: https://pypi.python.org/simple
Requirement already satisfied (use --upgrade to upgrade):
setuptools in /usr/local/lib/python3.5/site-packages
Requirement already satisfied (use --upgrade to upgrade):
pip in /usr/local/lib/python2.7/dist-packages
More details:
] python3
Python 3.5.2 (default, Jul 29 2016, 09:41:38)
[GCC 6.1.1 20160511] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import site; site.getsitepackages()
['/usr/local/lib/python3.5/site-packages']
>>>
^^^-- That seems correct and does not mention anything about the 2.7 packages directory.
It looks like it should only be looking in /usr/local/lib/python3.5/site-packages, but for some reason, it is also looking in /usr/local/lib/python2.7/dist-packages where it has no business in looking.
For example, look at what happens when I try to install psycopg2 as a Python 3 module:
] python3 -m pip install psycopg2
Requirement already satisfied (use --upgrade to upgrade):
psycopg2 in /usr/local/lib/python2.7/dist-packages
It is finding it as an installed package in the 2.7 distribution and failing to install its Python 3 version in /usr/local/lib/python3.5/site-packages.
To add even more confusion into the mix, I try going straight for pip 3, but to no avail:
] pip3 install psycopg2
Requirement already satisfied (use --upgrade to upgrade):
psycopg2 in /usr/local/lib/python2.7/dist-packages
] cat `which pip3`
#!/usr/local/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from pip import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
Update: PYTHONPATH was set to /usr/local/lib/python2.7/dist-packages. This was the cause of the issue above. Credit goes to user be_good_do_good for helping me figure out which screw to turn to get things to work as they should.
PYTHONPATH might have been set to 2.7 distribution packages, which might be causing this.
I am trying to use Scrapy in Python, but even if it is installed, afterwards it is not found when I try import it.
I am quite new at python and dealing directly with the Terminal, so probably I am missing one (or many) important points.
Details
This is what I get in the Terminal about the installation of Scrapy:
$ pip install Scrapy
Collecting Scrapy
Using cached Scrapy-1.1.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): six>=1.5.2 in /usr/local/lib/python2.7/site-packages (from Scrapy)
...
Requirement already satisfied (use --upgrade to upgrade): pycparser in /usr/local/lib/python2.7/site-packages (from cffi>=1.4.1->cryptography>=1.3->pyOpenSSL->Scrapy)
Installing collected packages: Scrapy
Successfully installed Scrapy-1.1.0
But then, when I want to import it, it is not found:
$ python
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import Scrapy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named Scrapy
Note that when I try to import scrapy inside a project, once I run it I receive the same error than trying to import scrapy directly in the Terminal.
I am on OS X version 10.9.5.
Approach tried
I am able to start a new project. For instance:
$ scrapy startproject tutorial
will be run successfully.
This make me think that the problem is somewhere in the link between scrapy and python, not in the installation of scrapy itself.
Documentation found so far
I have not found any additional information in the official documentation.
I have also looked in Stackoverflow and Google for similar problems, but did not find any helpful answer. Probably I am looking for the wrong keywords. The following topic seemed to be a similar problem, but I actually do not have any problem running pip nor did I get any error related to Cryptography.
Could anybody point me in the right direction?
I meet the same questions of that. Finally, I find that there are two python lib in my computer.
The scrapy was installed in the
D:\Python\IDE\Lib\site-packages.
But, python used the python lib in
D:\Python\Python 2.7\Lib\site-packages.
So, you install the scrapy success. But, the python use a wrong path to connect it. So, you may change the python path of the lib in the software or copy the scrapy to the python lib that your software use! I wish it can help you!
Try to use import scrapy instead of import Scrapy
Edit: Before you start deleting/modifying installs, please glance over StvnW's answer/summary to make sure you are applying the solution that is appropriate for you.
I've installed python 2.7.5 and pip [edit: mac OSX Mountain Lion.] I've run "pip install praw" in terminal. All good. When I run python and run "import praw" I get:
...$ python
Python 2.7.5 (v2.7.5:ab05e7dd2788, May 13 2013, 13:18:45)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import praw
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named praw
...same ImportError from a script.
when I install praw I get this:
$ pip install praw
Downloading/unpacking praw
Downloading praw-2.1.10.tar.gz (83kB): 83kB downloaded
Running setup.py egg_info for package praw
Requirement already satisfied (use --upgrade to upgrade): requests>=1.2.0 in
/usr/local/lib/python2.7/site-packages (from praw)
Requirement already satisfied (use --upgrade to upgrade): six in
/usr/local/lib/python2.7/site-packages (from praw)
Requirement already satisfied (use --upgrade to upgrade): update-checker>=0.6 in
/usr/local/lib/python2.7/site-packages (from praw)
Requirement already satisfied (use --upgrade to upgrade): setuptools in
/usr/local/lib/python2.7/site-packages/setuptools-1.1.6-py2.7.egg (from update-
checker>=0.6->praw)
Installing collected packages: praw
Running setup.py install for praw
Installing praw-multiprocess script to /usr/local/bin
Successfully installed praw
Cleaning up...
In python if I run help('modules') it isn't there.
Relatively new to python and I haven't been able to sort this out with google search. Any hints would be much appreciated.
Edit:
SitRep:
I've uninstalled 2.7.2, uninstalled praw, and uninstalled (homebrew) pip. I ran python 2.7.5 and it couldn't find the module (as you would suspect.) I then reinstalled pip with easy_install and now 2.7.5 is finding praw but giving this error:
$ python
Python 2.7.5 (v2.7.5:ab05e7dd2788, May 13 2013, 13:18:45)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import praw
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/praw/__init__.py", line 43, in <module>
from update_checker import update_check
File "/Library/Python/2.7/site-packages/update_checker.py", line 11, in <module>
from pkg_resources import parse_version as V
ImportError: No module named pkg_resources
>>>
Thanks for the help so far, the spurious install was the root of problem 1.
The solution to the final problem can be found here:
No module named pkg_resources
I wish there were some way to summarize this for future readers, but I've done so many things that I no longer recall what addressed what. I basically uninstalled everything (python 2.7.2, 2.7.5, praw, pip,) reinstalled 2.7.5 from http://python.org/download/, reinstalled pip with easy_install (and sudo command) instead of homebrew, reinstalled praw with sudo command, and followed the directions for the subsequent module error in the link above. Hope that helps. :)
The OS X system versions of Python live in /System/Library/Frameworks/Python.Framework/<verson>, each of which links to /Library/Python/<version>/site-packages. Seems like you have installed another version of python and/or pip to /usr/local, but when you invoke python you are still getting the system version.
Try this:
$ /usr/local/bin/python
>>> import praw
I'd also recommend looking into tools like pyenv and virtualenv if you are going to do any amount of work with Python. Pyenv lets you easily manage and switch between multiple versions (including micro versions x.x.3, x.x.5, etc). Virtualenv lets you create isolated Python environments where you can pin down versions of site-packages specific to a particular project.
Edit (summarizing):
sudo easy_install pip will install pip under /System/Library/Python/<version>. Calling that pip will install packages to /Library/Python/<version>/site-packages
brew install python will install a second version of python — including pip — under /usr/local/. That pip will put packages in /usr/local/lib/python<version>/site-packages/`.
One version may not see packages installed to the other.
which python and which pip are helpful for troubleshooting.
Dean's final solution above results in user packages being installed to the system site-packages.
Despite Dean's choice to update the system Python, many would advocate instead using brew, pyenv, and virtualenv to isolate oneself from the system Python.
It's strange. I am suspecting you have another version of python2.7 on your mac os
If you are using a mac. Check the version of python on your shell's path using which python. Then make sure that the shebang line in the script you are trying to run uses the same version of python.
In my terminal I typed
which python and got the output /usr/local/bin/python
I went to the script I was trying to run and added the following to the first line
#!/usr/local/bin/python
Then I went back to my terminal. Checked that I was in the same directory as the script I wanted to run and typed
./my_script.py
If you don't see any output at this point make sure that you have execution permission enabled for your script by typing chmod +x my_script.py in ther terminal. Then try running the script again using ./my_script.py