I am trying to install pygame. But I am not sure which version is appropriate for me.
I am working on a Windows 10 AMD64 PC.
The version of Python that is installed, shows-
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)] on win32
on typing python into the command prompt.
I can find the packages here and here.
But there are only items listed such as-
Download repository
pygame-1.9.2-cp27-cp27m-win32.whl
pygame-1.9.2-cp34-cp34m-win32.whl
pygame-1.9.2-cp35-cp35m-win32.whl
pygame-1.9.2-cp27-cp27m-win_amd64.whl
pygame-1.9.2-cp34-cp34m-win_amd64.whl
pygame-1.9.2-cp35-cp35m-win_amd64.whl
Now I have no idea which one of these is to get.
And, what are the differences among cp27, cp34 and cp35?
Please help me choose my version.
normally you should just type following command
py -m pip install pygame
On non windows system you just type
pip install pygame
and the correct file will be downloaded and installed.
The pip module will consult https://pypi.org to indentify the versions available and choses normally the right one
Related
I've tried to install the module bpy (blenderpy) to be able to run python-scripts for Blender directly from Spyder IDE with Python 3.8.5. However, I can't seem to find a good solution for this.
I've tried to follow this wiki on Github to use a build provided for bpy version 2.82. I installed every required program and tried to install bpy with !pip install bpy --no-binary :all: in the Spyder-console, like it was suggested in the wiki. Unfortunately, bpy version 2.82 is not compatible with Windows Python 3.8.5:
in build_cmake
raise Exception(f"{VERSION} bpy is not compatible with "
Exception: 2.82 bpy is not compatible with Windows Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] 64bit [...]
Otherwise the installation of bpy would probably have worked.
My question is now: Is there a more recent build for bpy which can be installed with pip and is compatible with (Anaconda) Spyder python 3.8.5? If not, which Anaconda-distribution of Python do I need to install in order to be compatible with bpy 2.82? How could you manually add modules (like bpy) to your Spyder IDE that aren't available in the Anaconda-Distribution of Python and can't be installed via anaconda.org?
I have downloaded pygame:
C:\>pip3 install pygame --user
Requirement already satisfied: pygame in c:\users\mpenn\appdata\local\programs\python\python38-32\lib\site-packages (2.0.0.dev8)
And I have python 3.8.3:
C:\>py
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 bit (Intel)] on win32
But when I try to import pygame in my "Wing Personal 7" IDE, I get the error:
builtins.ModuleNotFoundError: No module named 'pygame'
This has only started happening since I updated python to 3.8.3 yesterday.
make sure your python directory(the one where all the modules are stored) is added to the PATH variable. There are already many tutorials to do so:
How do I add Python to the Windows PATH
or if that doesn't work for you, google is your best friend.
In Wing, you need to change python executable to the python version you are using. python executable is found in Project, Project Properties...
Make sure that pip is up to date. Try running:
pip3 install --upgrade pip
I install python 3.6.5_1 using
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.r
and get
Warning: python 3.6.5_1 is already installed
The currently linked version is 3.7.3
You can use brew switch python 3.6.5_1 to link this version.
I use brew switch python 3.6.5_1 and get
Cleaning /usr/local/Cellar/python/3.6.5_1
Cleaning /usr/local/Cellar/python/3.7.3
4 links created for /usr/local/Cellar/python/3.6.5_1
Typing which python3, there is no output, which python gives
/usr/local/bin/python
and typing python3 gives
-bash: /usr/local/bin/python3: No such file or directory
typing python gives
Python 2.7.15 (default, Nov 27 2018, 21:24:58)
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
How do I make sure that the installed python3.6.5_1 is installed at correct location and is the one referred to by python3?
Extra background :
I have been working with OpenCV for around 5 months now, following this installation guide for installing all requirements including python3.6. I was using this version of brew's python instead of mac's one. Recently I had to install FFmpeg, some errors came up, unwittingly I did something (I don't remember, probably unlinked python) and then I wasn't able to install FFmpeg anyway but also this destroyed my workspace. Right now I keep getting the following error everytime I open up terminal:
-bash: /usr/local/bin/python3: No such file or directory
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3 and that PATH is
set properly.
I tried brew install python3 and that solves the above warning for virtualenvwrapper. But it installs python3.7.3, whereas I need python3.6 for tensor flow etc.
I installed the PyAutoGUI package using pip install pyautogui.
I can tell it's installed since I can import it using the PyCharm terminal:
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900
64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyautogui
>>> print(pyautogui)
<module 'pyautogui' from 'C:\\python\\anaconda3\\lib\\site packages\\pyautogui\\__init__.py'>
>>>
My problem is: When I try to add it to my project virtual environment, I can't find it on the available packages. Is there any way to add it manualy ?
P.S.: This is how I'm trying to add it:
File>Settings>Project>Project interpreter>install(the green plus button)>available packages>install
Since you cannot find PyAutoGUI on available packages (for me it is there), you can try running
pip install pyautogui
in the pycharm terminal. If you have already installed it in the global site-packages, pip will use the cached files in installation instead of downloading it again.
I work around this problem by uninstalling anaconda python and pycharm then reintalling pycharm and python (not anaconda), now i can add modules to my venvs no problem.
Note: at first, the available packages list was empty until i added "https://pypi.python.org/" to my repositories using the manage repositories button.
A few weeks ago, to dabble in IPython notebooks, I had downloaded and installed Anaconda from http://continuum.io/downloads. There was a problem in the installation (either because it was 32-bit or 64-bit — a detail I can't remember) which I solved but uninstalling my first attempt and installing the other version. Then I went about creating my notebooks with some practice problems.
Currently I can run ipython notebook in the command prompt and the notebooks run perfectly well. But the there's no mention of whether the system is 32-bit or 64-bit in the tree of notebooks (or in the tabs nearby).
I would usually sort such issues using the command prompt. But the commands conda --version and ipython --version just yield the respective version numbers and not the information I am looking for.
My operating system is Win7x64 but that hasn't prevented me from installing 32-bit softwares in past.
conda info has this information. If you need to access it programmatically, use conda info --json.
For CentOS 6.7 and miniconda2:
Type python and enter these commands:
import platform
print platform.architecture()
In my case, it gives:
('32bit', '')
Open a standard python console, and in the header it should tell you
Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>>
conda --v. It displays the Conda version