0

I know that similar- questions about installing modules in Portable Python have been
asked but I have looked at all of them and another website. I didn't have success.

For me, I wanted to install Pygame on Portable Python 3.2.5.1 (on a memory stick). I nearly
managed to install it successfully but when I typed import pygame into the shell window,
there was a weird error in one of the files, displayed in the shell. See image below:

The above described error - if you can't see it, it is also available here.

Update: Portable Python at time of writing has been discontinued (not being developed anymore)
and there are other alternatives available in suggested links on their website or internet search
engine query results. I have managed to add the Pygame Python module to my version
of one of these continuing projects so this question is not of use to me anymore.

Community
  • 1
  • 1
Edward
  • 1,062
  • 1
  • 17
  • 39

3 Answers3

0

I had this same problem today. I may have managed it. This is what I did:

I installed pygame to an empty folder so I could see all the things it needed. this was two folders:

Include>pygame and Lib>site-packages

I went to Lib>site-packages and copied all the things there, then pasted them into G:\Portable Python 3.2.5.1\App\Lib\site-packages

I also copied all the things in: G:\Include\pygame

and pasted them into: G:\Portable Python 3.2.5.1\App\include

from a quick play, this seems to work.

Lee
  • 11
0

Although it isn't really the proper answer I was looking for a while ago when I posted the question (how to install Pygame on Portable Python 3.2.5.1), I have a possible answer for my question that could work.

It is possible (although I haven't personally tested it yet) run a Python program using Portable Python and with the Pygame library folder stored in the directory the program is stored in. Python's module search path includes the current directory (of the running file) so import pygame would import it.

Edward
  • 1,062
  • 1
  • 17
  • 39
0

This question is old and maybe this is a possibility that was not possible at this time but simply:

  • From a command prompt go to your Portable Python's python.exe folder with cd <path to Portable Python>\App\Python,
  • Run: .\python.exe -m pip install pygame,
  • Now you have pygame module installed, you can check in your <path to Portable Python>\App\Python\Lib\site-packages that you have now pygame.

Note: I used Portable Python from here, version 3.10.5 at the time I wrote this.

gluttony
  • 402
  • 6
  • 14