Minecraft 1.5.2 MCP - python

I have a PowerPC Mac that is runing 10.5.8 mac OSX and has 2.5.1 python. When I try to run any file from the MCP folder that i download i get this error:
Macintosh-2:MCP Rosty$ bash
bash-3.2$ /Users/Rosty/Documents/MCP/updatemcp.sh
/Users/Rosty/Documents/MCP/runtime/commands.py:137: Warning: 'with' will become a reserved keyword in Python 2.6
Traceback (most recent call last):
File "runtime/updatemcp.py", line 13, in
from commands import Commands
File "/Users/Rosty/Documents/MCP/runtime/commands.py", line 137
with open(csvfile, 'rb') as fh:
^
SyntaxError: invalid syntax
I have looked on the net but no one has the same problem... can some one plzzz help ???

From the wiki: http://mcp.ocean-labs.de/index.php/MCP_Releases
You need to update Python to 2.7
edit: A simple google search confirms, http://www.minecraftforum.net/topic/1752529-mcp-error/

Related

pdfplumber to_image() OSError: exception: access violation writing 0x0000000000000008 in Windows 10

I was trying to use pdfplumber library in python (ver. 3.10.6) to convert some pdf pages to images but pdfplumber to_image() method throws the following error:
import pdfplumber
>>> myDOc = pdfplumber.open("CV.pdf")
>>> myImg = myDOc.pages[0].to_image(resolution=300)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\jjjku\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pdfplumber\page.py", line 381, in to_image
return PageImage(self, **kwargs)
File "C:\Users\jjjku\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pdfplumber\display.py", line 93, in __init__
self.original = get_page_image(
File "C:\Users\jjjku\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pdfplumber\display.py", line 54, in get_page_image
with WandImage(
File "C:\Users\jjjku\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\wand\image.py", line 9306, in __init__
wand = library.NewMagickWand()
OSError: exception: access violation writing 0x0000000000000008
Initially I tried to use this method from PyCharm but thiserror occurred, after that I assumed that maybe something is wrong with PyCharm configuration, so I tried the same from cmd and the result is above (the same error as in PyCharm). I suspect that there is something wrong with my Image Wand or Ghostscript configuration. I have Windows 10 on my computer. I tried some ideas from the net but without results.
Does anyone have any idea what can be the cause of this error and how to make it work?
So, following the advice, I reported it as a bug on pdfplumber project GitHub and I got a response that this is related to some problems with Wand library dependencies. The issue was resolved after I installed the following package:
pip install -U wand
In PyCharm I added Wand package to Python Interpreter Packages (make sure to have version 0.6.10, for 0.6.9 the error still occurred from what I observed)

Unable to run py2 virtual environment in command line

I'm trying to run a script (from udacity lesson quiz) which was written in python 2. The course instruction recommends using python 2.6 or 2.7 so I created a virtual environment in anaconda prompt using conda create --name py2 python=2.7 and then installed the required libraries using pip. After activating the py2 environment (version 2.7.18) I tried running a script from the lesson in both atom editor and anaconda prompt and i got SyntaxError in both cases. The error messages look like this:
for Anaconda prompt i got this:
(py2) C:\Users\fayolpc\Desktop\ml-mini-project\ud120-projects>python tools/startup.py
checking for nltk
Traceback (most recent call last):
File "tools/startup.py", line 6, in <module>
import nltk
File "C:\PYTHON\envs\py2\lib\site-packages\nltk\__init__.py", line 128, in <module>
from nltk.collocations import *
File "C:\PYTHON\envs\py2\lib\site-packages\nltk\collocations.py", line 35, in <module>
from nltk.probability import FreqDist
File "C:\PYTHON\envs\py2\lib\site-packages\nltk\probability.py", line 333
print("%*s" % (width, samples[i]), end=" ")
^
SyntaxError: invalid syntax
for atom editor i got this:
File "C:\Users\fayolpc\Desktop\ml-mini-project\ud120-projects\tools\startup.py", line 4
print "checking for nltk"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("checking for nltk")?
I can't figure out what the problem is and I have done a lot of searching for solution but can't find any. I'd really appreciate if anyone can help me out. By the way I'm new to both programming and this community. Thanks for considering to help.

Python Portable Install gives error

i am starting to use Databases and am using MariaDB, Got that ready, but i want Python integration so i can get started on the program.
I have downloaded PyMySQL-0.7.10.tar.gz from the official python website
and have unzipped and have navigated an Command Prompt to there using cd (dir).
My command is:
"G:\Python\Portable\Portable Python 3.2.5.1\App\python.exe" setup.py install
(Yes, i am on Windows 10 and i am using Portable Python. This is because i learn it at school but also want to be able to work at it at home.)
The error it returns is the following:
Traceback (most recent call last):
File "setup.py", line 4, in <module>
version_tuple = __import__('pymysql').VERSION
File "C:\Users\Natan Samuel Geldorp.Remytop-PC\Downloads\PyMySQL-0.7.10\pymysql\__init__.py", line 28, in <module>
from .converters import escape_dict, escape_sequence, escape_string
File "C:\Users\Natan Samuel Geldorp.Remytop-PC\Downloads\PyMySQL-0.7.10\pymysql\converters.py", line 60
_escape_table[0] = u'\\0'
^
SyntaxError: invalid syntax
Does anyone know how to fix this?
-Natan
As requested, as an answer:
You need a newer Python version, in 3.0 to 3.2 the u prefix was forbidden, it was allowed again in version 3.3.
Since Portable Python is no longer being developed (according to their site) you need to pick an alternative. One suggested on the site is WinPython.
(Also the PyMySQL site states that the minimum required Python versions are either >= 2.6 or >= 3.3)

MacVim vdebug python error

I am trying to use vdebug with MacVim and xdebug to debug code. I have MacVim and python installed via homebrew and xdebug is installed and working fine with MacGDBp.
When I listen in vdebug with the F5 key and reload a page (xdebug remote autostart is on) I get a python error in the vdebug quickfix window:
An error occured: <type 'exceptions.ImportError'>
Traceback (most recent call last):
File "/Users/mikedfunk/dotfiles/.vim/bundle/vdebug/plugin/python/start_vdebug.py", line 31, in run
self.runner.run()
File "/Users/mikedfunk/dotfiles/.vim/bundle/vdebug/plugin/python/vdebug/runner.py", line 160, in run
self.open()
File "/Users/mikedfunk/dotfiles/.vim/bundle/vdebug/plugin/python/vdebug/runner.py", line 74, in open
raise e
ImportError: No module named expat; use SimpleXMLTreeBuilder instead
I've googled this for a while and can't find a working solution. Any ideas?
This worked for me! Posted in case anyone else has the same problem:
https://stackoverflow.com/a/12697440/557215
It temporarily links the homebrew version of python to the mac system version before reinstalling MacVim. Now xdebug works!

Python on different computers report failed assertion differently

On the remote server I run my code on Python does neither output the exact line of a failed assertion nor the following comment. On my local machine the output is as expected.
What is the reason for that? Do I need to install additional packages?
Remote server:
...
Traceback (most recent call last):
File "classify.py", line 48, in <module>
print "start reading files"
AssertionError
me#remoe:~/foo$ python --version
Python 2.7.2+
On my local machine:
...
start processing training data
Traceback (most recent call last):
File "classify.py", line 83, in <module>
assert(test_images == 0) # no test files found
AssertionError
me#local:~/foo$ python --version
Python 2.6.6
[Update]
The code on the server is the same as on the local machine as I mount my local hdd on my server.
I tried writing a minimal example, but it was to minimal, so that there was no effect. I will try to build an more extensive minimal example where the bug occurs.
Can somebody point me to a tutorial to install another python version w/o messing everything up.

Categories

Resources