Is the wrong version of pygame being installed? - python

I'm borrowing my friends mac and I've tried following instructions of installing python and pygame using homebrew and all that. Specifically following this video: https://www.youtube.com/watch?v=L0Cl4Crg7FE
And this post: http://www.reddit.com/r/pygame/comments/2bsqe4/installing_python3_and_pygame_os_x_mavericks_and/
I've successfully managed to install python 3.4.1 and a version of pygame from https://bitbucket.org/pygame/pygame
So I now start to test my program to see if it works. But it doesn't because it says pygame has no pygame.movie module, which I am using to play a video.
I've done all of my programming on my windows7 computer using python 3.4.0 and pygame version 1.9.2a0, and it worked perfectly fine. Anyone know how I can solve this problem?

According to the README on the github repo you linked:
You should definitely begin by installing a binary package for your system. The binary packages usually come with or give the information needed for dependencies. Choose an appropriate installer for your system and version of python from the pygame downloads page. http://www.pygame.org/download.shtml
And that line that I bold-faced seems to be the root of your problem: You didn't install the dependencies, so you don't have video support, so when you built from source, it skipped pygame.movie.
Unfortunately, they only have binaries for Python 2.x, and only for older versions of OS X, which means you can't actually follow those instructions, and you're doing the right thing by building it manually.
I don't see where they list these dependencies on the download page. There's a link to Installation Notes, but it's a 404. And the README in the BitBucket repo doesn't list them either. (I'm not 100% sure BitBucket is the right place to look—the download page sends you to an svn repo, which sends you to the BitBucket repo, but the GitHub repo looks newer and just as official—but the GitHub repo has the same info…)
So… you may need to read through config_darwin.py and config_unix.py. But my first guess is that it's SMPEG or maybe avformat that you're missing, because SMPEG is how you display video in SDL, and avformat is how you convert video from other formats to something SMPEG can handle. So, if you don't have those, use Homebrew or the SDL.org binary installers or whatever you prefer to add them, then clean-rebuild PyGame.

Related

Is there any documentation about spyder reports?

I just found out about spyder-reports which can both generate the python code and the HTML output from the .mdw file. I installed it with pip, but then I didn't found any way to work with it. I am using spyder 4.1.3 with python 3.6.4, and nothing changed in the interface, opening a .mdw file doesn't seem to propose anything.. How does this plugin work?
Is there any documentation, examples, I could use to figure out how it works?
Unfortunately, no. According to their GitHub issues:
Sorry, this plugin is unmaintained now and it's not compatible with the latest release of Pweave. We'll come back to it after we release Spyder 4.
and
This plugin is unmaintained and not compatible with the latest release of Pweave. To help update it or see the status of that work, visit this link.
Your best bet at this time is to uninstall since the installation downgrades some packages:
pip uninstall spyder-reports
or
conda uninstall spyder-reports
Sources:
https://github.com/spyder-ide/spyder-reports/issues/76
https://github.com/nathancarter/spyder-reports/commit/5fcddd1503e17b5db8df6f0dbe7444f1698824a6

Installing/Using Pillow on Python 3.6 and Visual Studio

Alright, I need some pointers. I am missing something. I am trying to use Pillow through Python 3.6. The platform I use is Visual Studio 2017. I can't get it to work.
I downloaded Pillow from this website:
https://pypi.org/project/Pillow/
And ran the installer.
According to my research, I need pip to install it; which comes built-in python 3.6. I have seen sign that it is actually installed through my module in visual studio (pip 9.0.3). I simply need to use the following line:
from pip.commands import install
and also tried
import pip
Now, according to this:
https://pillow.readthedocs.io/en/5.2.x/installation.html
All I have to do is
pip install Pillow
Though other sites indicate that PIL is still being used. I have tried both without success. Pillow is not recognized and a error comes in: invalid syntax.
I am clearly doing something wrong. I consulted some youtube tutorial; they all skip that part. They download then go straight to their coding platform and it works.
I can only guess I have additional steps to do with Visual Studio.
Also... The location of my files might be out of whack due to IT security on my work laptop. Could that be an issue?
You can do the following:
python -m pip install pillow
No need to downloade Pillow from the website.
After that, to use it you can do:
import PIL
Thanks for the feedback. I played with Visual Studio some more; there is a way of getting it straight from the menu.
I opened a Python 3.6 project/solution. On the "Python Environment" node in the solution explorer, I right clicked and created a virtual Python environment.
Then I right clicked on the virtual environment and selected "Install Python Package...".
You can then search the package you need for your project.
I don't know if this is the most efficient way. From my research, I think the package are only applicable to my virtual environment; I still have to test that out to make sure.
I may have gone the long way around, but writing the proposed code did not work out. I am sure it works, but I am thinking I might not be using it in the right location.
Anyway, thanks for the help!

How to download previous version of Werkzeug

How do I download previous version of Werkzeug from a trusted site?
Here is what I have tried:
1) I went to this link:
http://werkzeug.pocoo.org/docs/0.9/installation/#installing-a-released-version
and clicked on the "Download Page" link.
It took me to the 0.10.4 download page.
2) I googled "Werkzeug download 0.9" and only got references to 0.10. There was a download link to a versioneye.com site that I don't know if I can trust.
I need to download the previous version because 0.10.x dropped support for support for OpenSSL.
[edit] I have to download rather than install from pip because I don't have access to pip on the old machine I am installing on. It is old, hence the complications.
[edit] I had to use the older version because 0.10.x dropped support for the OpenSSL package in favor of ssl built into Python 2.7.9. I was stuck on Python 2.7.5 so I wanted to continue to use OpenSSL package. I think they made the right decision to drop support as the majority of people can upgrade to 2.7.9.
You can install an old package with pip:
pip install Werkzeug==0.9.6
Building on f43d65's comment, I have refined it to these steps which include making sure it is coming from a reliable source:
goto the official website: http://werkzeug.pocoo.org/
click link to official github account: https://github.com/mitsuhiko/werkzeug
click on releases tab: https://github.com/mitsuhiko/werkzeug/releases
Note: the instructions make sure that the download is coming from the official source.
go in pycharm settings and then in interprator click on + there in packages and then search for werkzeug there, after click on versions and choose old version. it did work for me.

Installing Python GTK

I have recently stated a arduino project for my engineering class. I mange to get python to talk to arduino via serial communication. Now I can send data to the board, I want to be able to set up a graphical user interface GUI with GTK, so that the user and push a button in the GUI and a LED turns on. However, I am trying to install the GTK liberty and I am running into a lot of problems.
Problem:
I download GTK via pyip, when I run the set up file in the command line it says
you have to install pyobject. So i went back to pyip and download the pyobject module and run the set up file. When I run the set up file I get this error message "ERROR: Could not find pkg-config: Please check your PATH environment variable." I downloaded the pyconfig from pyip ran it and the set up ran fine. But when i went to install pyobject I keep getting this error. Can someone direct tell me how to install GTK properly or how to fix my problem.
PS I try setting my windows environment to the location of my pkg-config file.
Error from Installer
CMD error :
Help would be deeply appreciated
Thanks
Sean From Boxing Studio Games
I would suggest that you use the latest all-in-one installer for pyGTK. You can find it here.
It should automagically install all of the dependencies for pyGTK.
I believe that your problem is that you're trying to find non-Python prerequisites via pip.
You say "I download GTK via pyip", I don't know any package manager named pyip. If you mean pip, that only installs Python packages; it doesn't help get the DLLs and other files that are needed to build those Python packages. In particular, to install the Python bindings for Gtk+ and do anything useful with them, you have to have Gtk+ itself. You can get a nice installer package from the Gtk website.
Also, you have to be precise with names. If you're missing pkg-config, installing something called pyconfig isn't going to help; they have nothing to do with each other. Similarly, pip is the Python package installer; pyip is a library for dealing with raw IP packets; they have nothing to do with each other.
At any rate, the Gtk+ binaries should have all the prerequisites you need. Then pip should be able to install the Python bindings… assuming you have a compiler set up properly. But somehow, I have a feeling that you don't have one set up, and don't know how.
Fortunately, Christoph Gohlke's repo has prebuilt binary wheels for almost anything you could want in Python that's hard to build for Windows. Just download the .whl files you need from that package, and follow the instructions on the page to install them with pip.

Installing Pypotrace for python?

Did anybody manage to install pypotrace or is able to install mingwin it's like mission impossible for me I've passed the last 12 hours trying to found out how but nothing is working and description are poor please could any body help? This is where you can get it:
pypotrace web site
This problem was so much of a pain that I ported potrace to python directly rather than using hooks and requiring local compile.
pip install potracer
https://github.com/tatarize/potrace
I implemented the same API as pypotrace so it should be fairly painless.
Since you are working in windows you need the following steps:
You may need the python distutils package - pip install -U distuilts should do the job.
You will also need Cython - the windows installers are here.
You need to install mingw and make sure it is working in
msys mode - run msys and you should get a command prompt in it type
gcc --version and make sure you get a sensible reply.
also make sure your python runs from within msys
Do the required downloads:
potrace source,
agg source site broken or the GitHub zip file here,
potrace source from here and unzip it.
The follow the instructions at the link you gave and tell us where they stop working.

Categories

Resources