New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The "2to3" seems doesn't work while buliding matplotlib1.3.1 with python3.x #2655
Comments
Interesting. This should be working. Try deleting both the Failing that, can you send me the full output of |
Well……Finally I try to use 2to3 to modify the *.py file in /usr/local/lib/python3.3/dist-packages/matplotlib-1.3.1-py3.3-linux-x86_64.egg by myself. Like:
This works~ And after I did that, most program statement such as: import matplotlib does works without exceptions, and I can run some of the script in example folder, But there're also many script just can't work, such as all script in /example/animation/ (so many exceptions throwed out in animation.py)and some other script run with exceptions…… So I think matplotlib is just not suit for python3, because developers create it with py2, and we shouldn't wish the computer will transfor it perfectly ……I try to install it with python2, and all of them works fine~ |
Matplotlib 1.3.1 definitely works fine in python 3.3. So there must be something wrong with either the way you install it or the python installation on your computer. Without some more verbose output it is very hard to figure out what is wrong so please provide the output of running the installation. 2to3 should run as part of the build script, it is not a big surprise that running it after the installation does not work as expected. |
I reinstall it using the command:
And code import matplotlib still get the same error:
2to3 doesn't work…… My Ubuntu13.10 installs both python2.7 and python3.3 in default. I mean the '"python" command refers to python2.7 and the "python3.3" refers to python3.3. Maybe this is what cause the problem? And here is the installation output. Thank you for replying! |
No because that is perfectly standard and works for everybody else. Can you please delete the build folder within your source dir and rerun:
And paste the output of that into a gist here. The output of the installation is less relevant because that is not when 2to3 is supposed to be running. |
This is how it looks for me https://gist.github.com/jenshnielsen/7870124 After the copying you will see some lines with fixing and skipping. These are 2to3 running on the code before compiling the CPP extensions. |
Amazing! It works! I delete the build folder and rebuild it, the code in colors.py has been modified, like: # add british equivs
for k, v in list(cnames.items()):
if k.find('gray') >= 0:
k = k.replace('gray', 'grey')
cnames[k] = v Strange thing is that when I delete all of the source dir and uncompress a new one from the matplotlib-1.3.1.tar.gz package and rebuild, it will get into the same trouble mentioned above, while I only delete the build folder then rebuild, it performs well ! Command:
End of file |
Anyway, most of the scripts in example folder can run normally, but still some of them just can't work.(like scripts in animation folder) The same result as I modify the script myself……It's a challenge to make the matplotlib suitable for python3. |
Closing this because it was primarily a local install/configuration issue. |
Hi!
However, after googling around and reading this thread, I went back into the matplotlib-1.3.1 folder,
|
My OS is ubuntu 13.10.
When I install mpl I tried :
These all works fine……But when I create a new script like this:
It throw me some errors, and obviously this is because of the differences between py2.x and py3.x
I try to google it and found this:
#1401
In that issue @pelson sad that 2to3 will run for the user. But I don't think so!
After install, I open the /usr/local/lib/python3.3/dist-packages/matplotlib-1.3.1-py3.3-linux-x86_64.egg/matplotlib/colors.py
and in this file I found:
So you see the 2to3 doesn't work at all.
Then I copy the file to another place, and try to change it myself to test:
this command only shows information on SCREEN, and dosen't do anything to the file itself!
only add
-w
options will the 2to3 really work.this works right. And in the colors.py the code above changed to this:
I try to find where the SETUP and MAKE file use 2to3 but failed. So can anyone tells me how to do it?
Sorry for my poor English and thanks in advance!
The text was updated successfully, but these errors were encountered: