I don't know how to get Py2app - python

I'm on Mac OSX 10.10.2. I've tried this once before and got a lot of hate for not being as smart as people assumed I was. I'll say this right now: I don't know anything about Terminal.
I do not have working pip, and I tried following these instructions to install pip, but even though I have get-pip.py sitting right on my desktop, whenever I execute the command it tells me to in terminal, I get an error: "No such file or directory." Can someone walk me through the steps of getting Py2app, and pip if that's necessary? I apologize in advance for my stupidity, and thanks for the help!

Even after I downloaded get-pip.py, it wasn't working because I didn't specify the location. Before executing python get-pip.py, I had to speficy location. So, on the first line of Terminal, type cd ~/Desktop and press enter. Then execute python get-pip.py, and it should work. Did for me!

Related

No tray and desktop icons afte python upgrade + additional problems

I have deleted old python versions and installed new python (version 3.5.2) and after i restarted computer I have lost system tray and icons on the desktop. I found some solutions that are based on setting up CCSM over terminal but it's not that simple as it looks like. There is no terminal and no ccsm installed anymore so i have followed one tutorial where you need to click on desktop, create new folder and try to run terminal from /usr/bin/ directory. Because there was no terminal i found xterminal and started with entering commands like DISPLAY=:0 ccsm but i got error "bad interpreter".
Anyways, i found some way to delete and reinstall python and i can see its installed in Python-3.5.0 directory. So i was thinking i start the DISPLAY command thru script and run it with python3.5 someScript.py command. That part was success but then i got error " no ccsm " which is true. So...
1.) i try to install with sudo apt-get install compizconfig-settings-manager
but i got error https://ibb.co/Jdm6BFf
2.) after googling i found some solutions for this but then i land it in the same problem:
https://ibb.co/x8LHFjy
3.) btw. i try to install "minimal" version of python and it was installed but with some errors.
It looks like that path to python is not a problem, because I run the script directly so it must be missing packages, i have no clue how to update it or what to do next...
Purging python and trying to reinstall again ?
Thank you guys for your answers !
E.

Can't run Python programs from the terminal window, how do I fix this? (Windows 10, Python version 3.8.5)

I've been studying Python for a month now and normally I run all my programs in Sublime Text 3.
Today I learn to run Python programs in the terminal window as introduced in this section of the Automate the Boring Stuff with Python book following this video. Basically, I followed the instruction in the video and created the hello.py file as below:
#! python3
print('Hello, World!')
Then I opened the Command Prompt to run the file with the command: py.exe c:\users\danh\mypythonscripts\hello.py,
an error pops-up and states that "This app can't run on your PC" and a line says that Access is denied. I spent the whole day trying to fix this problem but still I couldn't get it running.
One thing is when I change the directory of the Command Prompt to run the file to C:Windows\system32 (or run the Command Prompt as Administrator) and then run the command py.exe c:\users\danh\mypythonscripts\hello.py, it runs the file without any problem as in this image.
Does anyone know how to fix this problem? Any help is appreciated. Thanks!
I solved the problem.
When I looked into my user directory at C:\Users\<Username>, it appears that there is a py.exe file that has 0 bytes.
I was told in this thread that the py.exe file shouldn't be in my user directory so I removed that file and it fixed the problem.
I still don't know how the py.exe file got into my user directory and why it has 0 bytes so I'm not sure this solution could help others. For now, I will accept my own answer because it solves the problem in my case.
It looks like you're trying to use Microsoft's new Windows 10 Metro-based auto-installing version of Python. It's included by default but, as you've found, it doesn't work very well.
Try installing the version from the Python website.
If you've got a 32-bit copy of Windows, make sure to install the 32-bit version; Windows isn't very good at running 64-bit programs from a 32-bit kernel. You can check by looking in your C: drive; if you haven't got a Program Files (x86) folder, install the 32-bit version.
python.exe inside my env\Scripts\ became 0kb for some reason. So I created another virtual-env and copied python.exe from there to this folder. then it started working.

pygame.error: Failed loading libmpg123.dll: Attempt to access invalid address

music = pygame.mixer.music.load('not.mp3')
pygame.mixer.music.play(loops=-1)
when executing the code I got this error:
Traceback (most recent call last):
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\Escape it!.py", line 15, in <module>
music = pygame.mixer.music.load('not.mp3')
pygame.error: Failed loading libmpg123.dll: Attempt to access invalid address.
I have tried everything from giving full path to only the name but everytime this shows up
Just close whatever IDE you are using and restart the system. It worked for me!
Restart your IDE if that doesn't work try restarting your PC it worked for me!!
Doing following steps maybe solve the problem:
Step 1: Go to browser and search download libmpg123.dll.
Step 2: download libmpg123.dll and Extract it.
Step 3: After Extract (cut or copy) the two docs and paste in "C:\Windows\System32".
Step 4: Installation successfully done.
And this is also works :-
music = pygame.mixer.music.load('not.mp3')
pygame.mixer.music.play(loops=-1)
Thanks You
All the options given above didn't work for me. So, i uninstalled and reinstalled the "pygame" library from this site. https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame. which worked well.
When you newly install the pygame, it require system restart.
Just Restart your PC/Laptop
and then Run the code, it will not throw any error.
The answer of #jrsylvester right, but there is some questions.
Why and when you will get this type of error?
Why need to restart the pc/laptop?
Answer : When you newly installed the pygame and execute your code, then it will throw an error.
The system require a reboot to setup their file or code for working environment. so restart your PC/Laptop.
Happy Coding..!
Go to the directory where pygame is installed (you can get it by typing pip install pygame).
Look for the libmpg123.dll in pygame directory.
Copy and paste to C:/windows/system3 and C:/windows/sysWOW64.
1.Go to the directory where pygame is installed (you can get it by typing pip install pygame).
2.Look for the libmpg123.dll in pygame directory.
3.Copy and paste to C:/windows/system3 and C:/windows/sysWOW64.
I got this error message because I used the version of Python that was installed from the Windows Store. I reinstalled from official Python and the error went away.
Had the same issue. Surely enough just restarting my IDE or computer didn't help as well as copypasting libmpg123.dll to Windows directories or simply reinstalling pip/pygame.
I was using Python 3.9 from Microsoft Store. Before giving up and reinstalling Python from Python.org, I downloaded pygame‑2.1.2‑cp39‑cp39‑win_amd64.whl and then run:
pip install pygame-2.1.2-pp38-pypy38_pp73-win_amd64.whl
This worked perfectly well for me without python reinstallation.
I was under the same problem what i did was simply Install another IDE or just try reinstalling pygame.

Getting "targetdir variable must be provided when invoking this installer" message

when i try to install python i'm getting the "targetdir variable must be provided when invoking this installer" whilst attempting to install python 3.5. I have used tried to Run as admin however, I', still getting this error.
I had the same problem today and it did not work even with "run as administrator".
To solve the problem, I ran powershell as administrator and executed the following command:
python-3.6.1.exe InstallAllUsers=1 TargetDir="c:\python3.6"
Just right click on exe file and run as a administrator.It worked for me :)
I met this issue also.
I find method to resolve it.
Right click the exe file and choose run as administrator.
Then it can go on installing and to be successful.
Run as administrator solves this problem!
I was trying to install the latest python for windows python-3.7.0b4-amd64-webinstall but got the same error.
The problem was solved by the following steps:
Open command prompt in administrator mode.
Go to the location where the installer is downloaded.
C:\>cd C:\Users\XYZ\Downloads
C:\>python-3.7.0b4-amd64-webinstall.exe TargetDir=C:\Python37
The installer will open and chose the default installer and click Install.

Problems with Pygame on MAC OS X

I am having trouble setting up Pygame on my MAC. Here are my specifications: OS X El Capitan 10.11.4. Whenever I run a file with import pygame I get the following error message in terminal:
ImportError: No module named 'pygame'
If I try to install pygame from bitbucket that the directions, which I am following told me to do, I get the following message:
-bash: /usr/local/bin/pip3: /usr/local/opt/python3/bin/python3.5: bad interpreter: No such file or directory
Again, that message appears when I run the following command, in terminal:
enter code here pip3 install --user hg+http://bitbucket.org/pygame/pygame
I have tried Youtube videos and stack overflow but nothing seems to help me. I believe, but I am not sure, that I am still pointing to python 2.7 and I have no idea how to fix that. I believe I am using python 3.4. I find problems similar to mine but not sure exactly what to do. Any help would be great! Thank you!
Note, I'm not currently on a mac so I'm doing kind of from memory and what I assume should work so some of this might be different for you.
open terminal and type:
which python3
Copy the value of what the which command returns.
Open up your ~/.bash_profile using a text editor, I think you can just type (but not sure)
edit ~/.bash_profile
and you can add these two lines into your bash profile:
PATH="[Replace me with what the which command returned]:${PATH}"
export PATH
save and then in your terminal window you can type:
source ~/.bash_profile
echo $PATH
python --version
to verify that it's picked up your changes.
A few caveats I can think of are compatibility between things using python 2.x and 3.x, and this could break existing programs, so if you need to change back for whatever reason just delete the lines you added into your bash profile.
I found that the information at this site worked: https://bitbucket.org/pygame/pygame/issues/82/homebrew-on-leopard-fails-to-install

Categories

Resources