Using Google App Engine SDK with Python 2.7 on Mac OS X 10.6 - macos

I need to run Python 2.7 on my Mac Snow Leopard, which has Python 2.6 installed. According to this answer, running the Python 2.7 mpkg installer from Python.org should get me there.
The reason I need to do this is that I'm trying to run the Google App Engine SDK for the Python 2.7 runtime.
After installing Python 2.7, I'm still getting the following warning in my GAE server log:
Warning: You are using a Python runtime (2.6) that is older than the
production runtime environment (2.7).
What else must I do to get the GAE SDK to recognize the new Python version?
EDIT 2:
Running:
$ sudo find / -name python2.7
I get:
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/usr/local/bin/python2.7
According to the answers I went into GoogleAppLauncher -> Preferences and set the Python path to each of these, and each time I get the exact same error.
Running dev_appserver with the following flags:
--admin_console_server= --port=8081 Python command: /Library/Frameworks/Python.framework/Versions/2.7 2011-11-14
16:12:24.726 GoogleAppEngineLauncher[57590:203] *** NSTask: Task
create for path '/Library/Frameworks/Python.framework/Versions/2.7'
failed: 22, "Invalid argument". Terminating temporary process.
Another Wierd thing is, it always tries to resolve to the same path, no matter which of those I plug in; It always reverts to /Library/Frameworks/Python.framework/Versions/2.7
EDIT 3:
OK, after entering the paths into the prefs field repeatedly, I finally just cleared it out, and somehow it's now pointing to the right place:
Running dev_appserver with the following flags:
--admin_console_server= --port=8081
Python command: /usr/local/bin/python2.7

Open the GAE launcher preferences and set the Python Path option to the fresh installed Python 2.7, in your case /usr/local/bin/python2.7 .

Came across this question looking for a solution to the same dilemma regarding Mac, GAE and Python.
One comment I would like to make regarding setting the Python path using GAE Preferences. I notice you mention that you had a problem setting the Python path using the Preferences. I discovered that after editing the path, you have to press Enter. Otherwise, the path doesn't get updated. This might explain the weirdness you were mentioning when trying to edit the path field.

I installed python 2.7.x from macports. I see this:
$ python --version
Python 2.7.2
$ which python
/opt/local/bin/python
So, in the preferences for GoogleAppEngineLauncher.app I set the python path to:
/opt/local/bin/python
In the console log, I see this:
*** Running dev_appserver with the following flags:
--admin_console_server= --port=8081
Python command: /opt/local/bin/python
I still see some errors about libraries, in particular Can't open zipfile...setuptools but simple stuff at least seems to work.
Good luck!

I am not sure if it helps, but instead of using the binaries from Python, I used MacPorts http://www.macports.org/ and installed the Python 2.7 runtime:
sudo port install python27

Related

Mujoco in Ubuntu error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1

I was trying to install Mujoco in Ubuntu. I have downloaded mujoco200, and put it to ./mujoco with the license. Then downloaded mujoco_py with 'pip3 install mujoco_py==2.0.2.8'. According to the instructions I read online that should be all, and then when I run 'import mujoco_py', the following error shows:
distutils.errors.CompileError: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1
Does anyone know how to solve this problem? If not, I am using Mac M1, does anyone know how else can I use Mujoco since I don't think I can use Mujoco in Mac M1?
At first, the terminal asks me to put 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/yilin/.mujoco/mujoco200/bin' in .bashrc, I did that and that bug is gone. But now this bug comes up. I have tried to use Mujoco with Mac, use mujoco_py in colab and both of them failed.
Any particular reason you want to use mujoco 2.0.0 rather than a later version of MuJoCo? mujoco_py supports the free MuJoCo since November last year (install mujoco_py==2.1.12.14).
Or better, avoid mujoco_py, and use the mujoco package on pip instead. If you're using Gym, read their note about the latest MuJoCo environments: https://github.com/openai/gym#mujoco-environments
Using mujoco rather than mujoco_py will avoid all installation problems, because the MuJoCo binary is included in that Python package and doesn't need to be installed separately. It works fine on Mac M1.

I can’t get Kivy to work in Visual Studio

I’ve installed Kivy with Python and when I check the version it confirms that it’s there. But when I try to use files in VS, I get the message “kivy files require # kivy”.
I’ve searched for solutions to this but I can’t find anything.
Thanks
Thomas
I had a similar problem early on. What worked for me is as follows:
Going to Terminal or Command Prompt and typing
python3 -m pip install kivy
or
python3
then
>>> pip install kivy
I used another IDE called Mu Code (for Python) and tried it there. If it works for one application, it should work for all of them. Some other applications (like Mu) have a feature called the REPL, a read-evaluate-print-loop, that works like a python version of the terminal.
Also, be sure to check that you have correctly installed the latest version of Python. As of time of writing, the most current Python version is 3.10.5. You can download it from https://www.python.org/downloads/.
You can also try using the Python IDLE.
You can check if it's installed by using python3 -m kivy at the command line.
In the end, what worked for me was a lot of troubleshooting.
Hope that was helpful.

I'm trying to set up the emscripten SDK on Windows 10 but emcc can't be found

On linux there's no problem but I want to compile my code on windows. I follow the instructions exactly. Specifically, I open a command prompt and run the following in the same directory I cloned the emscripten git repo in to.
git pull
emsdk install latest
emsdk activate latest
emsdk_env.bat
There is suspiciously no output and emcc cannot be found. What could I be doing wrong here?
If you go to the command line and type python --version the version of python installed should come up.
If it doesn't, go to the directory in which python is installed and add this to your PATH.
Restart the command prompt and try python --version again. If you get the version of python, follow the steps you mentioned.
You should get some output.
Let me know if the problem still has not been resolved.
You need to install Python 2.7.12 or newer.
https://emscripten.org/docs/getting_started/downloads.html#windows

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-aadithyasb'

I am using WSL in Windows 10. I have this warning getting displayed when I run a python file:
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-aadithyasb'
I can understand that the XDG_RUNTIME_DIR environment variable is not set and it is creating its own path /tmp/runtime-aadithyasb
I am getting this warning from the moment I installed Xserver for Windows using VcXsrv to open plots when the file is ran.
Wy question is should I add this XDG_RUNTIME_DIR environment variable in windows or is there any method to set a directory under the variable for Ubuntu used under WSL?
I was able to find what the caused the terminal to issue the warning. Yet I am posting this so that it would be useful for people someday who are new to using WSL like me. This link helped me to solve it and gave me a better insight on how linux works under a WSL:
https://dev.to/winebaths/getting-up-and-running-with-the-windows-subsystem-for-linux-8oc
To solve this issue I just added the below lines to my .bashrc file:
export XDG_RUNTIME_DIR=/some/directory/you/specify
export RUNLEVEL=3
After this just run the command
source .bashrc
Now the warning will not keep displaying in your terminal.
Last week, I had a similar error installing a Orange3's library
My environment is:
Ubuntu 18.04
python3 (3.6)
orange3 (3.27.1)
pyQt5 (5.15)
The trouble was:
When I tried to compile orange3 in a command line:
sudo python3 -m Orange.canvas
The system showed:
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'/home/rene/.local/lib/python3.6/site-packages/orangewidget/widget.py:287: RuntimeWarning: subclassing of widget classes is deprecated and will be disabled in the future.Extract code from OWBaseVectorizer or explicitly open it.RuntimeWarning)
Fault segment
The trouble for this system error was:
Orange3 (3.27.1) is not compatible with PyQt5 (5.15).
However, PyQtWebEngine will be compatible with a PyQt5 upper version to 5.12
I searched in internet the different versions of rhis library and I installed a version between 5.12 and 5.15
Thus, I did I had a downgrade of the PyQt5's library to 5.13.1:
pip3 install PyQt5 == 5.13.1 --use-feature = 2020-resolver
As result of this:
Orange3 compile again
I had this problem too just today. What I did was that I opened up PowerShell and killed Ubuntu WSL with the following command:
wsl.exe --shutdown
After that, I opened VcXsrv with its shortcut called "XLaunch" and made sure to tick off "Disable access control".

Incorrect check of SIP version during PyQt installation

I have been trying to install PyQt on my mac (OSX 10.6.8), but I still having this problem:
When I try to install PyQt-mac-gpl-4.9.6, I get this
Error: This version of PyQt requires SIP v4.14.2 or later.
The weird thing is that when I want to check for sip version on the console and write
sip -V
,I get the correct version: 4.14.2
I have checked my PATH but non of the online tips that I have found have helped me. How do I fix this?
I would recommend checking to see if you have sip installed in different locations, with the newer version being in a path that is not at the head of your PATH.
mdfind -name sip | grep '/bin/'
This should tell you all of the sip binaries on your computer. Check the version of all of them, and then make sure that path is at the front of PATH
What it could actually be, regardless of it seeming like you only have one sip, is a leftover .pyc file that is getting picked up before your intended sip. Try this to confirm:
$ python
>>> import sipconfig
>>> print sipconfig
This will tell you where it is finding sipconfig. If it looks like the wrong spot, or if you check it and all that is left is the pyc file, remove it. Then your newer sip should be found properly.
I had a similar issue after installing sip 4.14.2 over a previous version of 4.13.1 on Mac OSX 10.7.4 and Python 2.7. Strangely, the version of sip from the command line was different from the version from the Python sipconfig module.
$ sip -V
4.14.2
$ python -c "import sipconfig; print sipconfig.version_to_string(sipconfig.Configuration().sip_version)"
4.13.1
I ran through the install again, this time with running the install step as 'sudo make install' and the two versions matched at 4.14.2 and the PyQt instal was successful.
$ cd ~/Downloads/sip-4.14.2/
$ python configure.py
$ make
$ sudo make install

Resources