Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: What version of Python for Windows 7 64 bit?  (Read 29474 times)

0 Members and 2 Guests are viewing this topic.

ingwik

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
What version of Python for Windows 7 64 bit?
« on: November 17, 2011, 09:47:08 am »
So, I am a bit curious about other implementations than SFML for c++ when teaching youngsters programming and my eyes fell on PySFML. C++ is tough to learn if you've never done any kind of programming before (and python not too tough for me to learn I hope :). But then, before I try something stupid that might spoil a lot of time for me, I have some questions that I would love to get answered:

What is best, PySFML 1.6 or PySFML 2.0? When I startwed teaching SFML for C++ I choose 1.6 but that might have been a bad move and I really don't want to repeat it.

PySFML is not a compiled language (as far as I know) so it shouldn't matter if I use a 32 bit or a 64 bit environment, or am I wrong?

Most important; what kind of Python distribution do I need to use on the computer if I have Windows 7 enterprise 64 bit. Current versions are 2.7.2 or 3.2.2. Can I use the latest or do I need to use an older version?

bastien

  • Full Member
  • ***
  • Posts: 231
    • View Profile
    • http://bastien-leonard.alwaysdata.net
What version of Python for Windows 7 64 bit?
« Reply #1 on: November 17, 2011, 12:59:42 pm »
I think you should use SFML 2, for the reasons mentioned here: http://pysfml2-cython.readthedocs.org/en/latest/introduction.html#why-sfml-2

Python 2.x and Python 3.x are not compatible. It's explained here: http://wiki.python.org/moin/Python2orPython3
Once you've chosen the major version, you should get the latest version available (e.g. 2.7).
 
Strictly speaking, Python 3 is better, but a lot of libraries still haven't been ported and the changes aren't really huge anyway, so a lot of people stick with Python 2, including myself.

I haven't tested pySFML 2 on Windows 64 bits, but normally, 32 bits applications run fine on 64 bits systems.
Check out pysfml-cython, an up to date Python 2/3 binding for SFML 2: https://github.com/bastienleonard/pysfml-cython

ingwik

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
What version of Python for Windows 7 64 bit?
« Reply #2 on: November 17, 2011, 03:25:13 pm »
So, in short:
*I should use Python 2.7.2.
*I should use SFML 2.0 - but I have to compile it myself with VC++ 2010 express since it is intended for 64 bit system.

Then I assume python 2.7.2 will work with SFML 2.0 compiled for a 64 bit system, or do I have to compile SFML for a 32 bit system?

kolofsson

  • Full Member
  • ***
  • Posts: 100
    • View Profile
What version of Python for Windows 7 64 bit?
« Reply #3 on: November 17, 2011, 04:37:48 pm »
Quote from: "ingwik"
So, in short:
*I should use Python 2.7.2.
*I should use SFML 2.0 - but I have to compile it myself with VC++ 2010 express since it is intended for 64 bit system.

Then I assume python 2.7.2 will work with SFML 2.0 compiled for a 64 bit system, or do I have to compile SFML for a 32 bit system?


No no no no no. :D

What you're saying creeps me out so much I want to shout :).

I'm a python noob and I went through all shit myself recently.

I installed both python 2 and 3 and what I can say is that Python 3 works fine, but it fails when I want to make a redistibutable exe file of my app to share with other users. PyInstaller which is the best app that packages all dll files in one EXE does not support Python 3. That is why I went back to Python 2.

About compiling SFML: You do need to compile it yourself, but why 64bit version? If you compile SFML in 64bits then it will not work on ANY 32bit windows (including windows 7). If you compline SFML in 32bits, you get library that will work on both 32bit and 64bit systems.

This is the most important advice: DO NOT COMPILE SFML USING VS2010. Python was built using VS2008 (MSVC 9.0) and all Python-based software wants to build other libraries using this IDE. If you have VS2010 you will go though a lot of errors, starting with installing Cython. Solution: Install Visual Studio 2008 and compile SFML and PySFML with it.

Also, don't install Pyhton 3 if you're using MinGW, i think it does not support Unicode, right?

To finish off, I can upload my own compiled SFML and PySFML, along with a working Pong example if you wish, this will save you a lot of the hassle.

ingwik

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
What version of Python for Windows 7 64 bit?
« Reply #4 on: November 18, 2011, 10:43:05 am »
Thank you very much for your answer.

Why 64 bit?
Well, all students in my high school (1 to 1 laptop policy) have Win  7 enterprise edition 64 bit system, so it felt natural to "go with the flow" and not look at older technology. There is a 64 bit version of Python 2.7.2 to install in Windows  too so I figured that since Python is a scripted system, then it shouldn't be a hassle using 64 bit rather than the older 32 bit standard.

Why VC++ 2010?
VC++ 2010 express is already installed in the pupils laptops since we are using that version for SFML 1.6 for C++  now. The problem for me as a teacher is that I think Python might be easier to learn how to program with than C++. C++ has a quite high abstraction level and is a bit hard to get a grasp on. I have this thought that it might be better for the pupils to learn Python the first 6-12 months and then move on to C++ the rest of the time (it's a 2 year course in all).

What I should do then is to:
*Remove VC++ 2010 express and install VC++ 2008 express instead
*install Python 2.7.2, 32 bit version
*Download SFML 2.0
*Compile it in a 32 bit system (?) with VC++ 2008
(Is it even possible to compile for the 32 bit platform if I have a 64 bit PC to do it with?)

kolofsson

  • Full Member
  • ***
  • Posts: 100
    • View Profile
What version of Python for Windows 7 64 bit?
« Reply #5 on: November 18, 2011, 12:30:10 pm »
Hi ingwik

If your students have VS2010 on their PC's, then in makes no sense at all to uninstall it on all their machines. Remember that the only reason you need Visual Studio is to compile the SFML libs and the PySFML binding. You can do that at home and then just distribute the libs to the kids. Also, I can give you my compiled libs and save you some work. I'm at work now and don't have these files on me and I keep forgetting about it when I'm back home.

Regarding the 32bit-64bit. You can run and compile 32bit apps on Windows 7 x64, because it supports 32bit natively (it does not support 16bit app though). There are two differences between 32bit and 64bit: speed and compatibility. 64bit is faster but 32bit will run everywhere. I should mention that most computer games and applications are made in 32bit (it's logical since majority of people still have 32bit systems installed, so bigger customer base).

Python 2.7 vs Python 3: If you don't want to distribute your python apps, use python 3, but if you want to make EXE files, I suggest Python 2.7.

So for the list of steps, I suggest:
1. Tell your students to install Python 2.7.2 32bit.
2. Get PySFML libs from me.
3. You may need to install MSVC++ 2008 Redistributable package
4. Either use IDLE that comes with Python or install one of these editors.

bastien

  • Full Member
  • ***
  • Posts: 231
    • View Profile
    • http://bastien-leonard.alwaysdata.net
What version of Python for Windows 7 64 bit?
« Reply #6 on: November 18, 2011, 05:12:38 pm »
Don't forget that I uploaded a compiled module for 32 bits Windows (should also work on 64 bits) that contains SFML and dependent DLLs: https://github.com/bastienleonard/pysfml2-cython/downloads
But nobody commented about it, so all I can say is that it works on my XP machine where SFML is already installed.
Check out pysfml-cython, an up to date Python 2/3 binding for SFML 2: https://github.com/bastienleonard/pysfml-cython

kolofsson

  • Full Member
  • ***
  • Posts: 100
    • View Profile
What version of Python for Windows 7 64 bit?
« Reply #7 on: November 18, 2011, 10:33:19 pm »
Quote from: "bastien"
Don't forget that I uploaded a compiled module for 32 bits Windows (should also work on 64 bits) that contains SFML and dependent DLLs: https://github.com/bastienleonard/pysfml2-cython/downloads
But nobody commented about it, so all I can say is that it works on my XP machine where SFML is already installed.


Oh yes I was going to test this, so I did. It does not work for me. The error happens on import sf: Cannot find module. I pasted all SFML libs, ext libs and sf.pyd along with the py file. When I replaced them with my libs, it worked.

Here are my libs:

http://grebocin.com/upload/pysfml2.zip

These libs were compiled for Windows 32bit Python 2.7.2 using VC++ 2008. This means that to run it you need to install the VC++ 2008 redistributable. The redistributable contains common libraries for all programs compiled in VC++.

bastien

  • Full Member
  • ***
  • Posts: 231
    • View Profile
    • http://bastien-leonard.alwaysdata.net
What version of Python for Windows 7 64 bit?
« Reply #8 on: November 18, 2011, 10:55:05 pm »
Can you use this tool to see which libraries fail to load?
http://www.dependencywalker.com/
Check out pysfml-cython, an up to date Python 2/3 binding for SFML 2: https://github.com/bastienleonard/pysfml-cython

kolofsson

  • Full Member
  • ***
  • Posts: 100
    • View Profile
What version of Python for Windows 7 64 bit?
« Reply #9 on: November 20, 2011, 02:57:41 pm »
Quote from: "bastien"
Can you use this tool to see which libraries to load?
http://www.dependencywalker.com/


I'm not sure if know how to use this tool and if I should have examined the sf.pyd file, but there it goes:



http://grebocin.com/upload/sf.dwi

I downloaded the two missing files libgcc_s_dw2-1 and libstdc++-6 and now your libraries work LOL. I guess some MinGW redistributable would be required :D.

If I might suggest anything, you could use the Pyinstaller to convert the pong example to an execuable. It does a miraculous work of putting all missing DLLs in the folder together with the EXE, or even putting everything inside a single EXE file.

When I ran the Walker through my sf.pyd, these 2 were missing: GPSVC and IESHIMS. They are also missing in your sf.pyd. I have no idea why both run fine without these DLLs.

bastien

  • Full Member
  • ***
  • Posts: 231
    • View Profile
    • http://bastien-leonard.alwaysdata.net
What version of Python for Windows 7 64 bit?
« Reply #10 on: November 20, 2011, 11:01:28 pm »
Thanks. I'll try to compile the standard library statically.
I guess the other errors are due to this:

Quote
Missing delay-load dependencies are not a problem as long as the calling DLL is prepared to handle the missing module. Dependency Walker flags all potential problems as it cannot detect if an application intends to handle the issue.


http://www.dependencywalker.com/faq.html
Check out pysfml-cython, an up to date Python 2/3 binding for SFML 2: https://github.com/bastienleonard/pysfml-cython