1

I am working on an assignment for school, and didn't realize that I needed to install the pygame/livewires package to use the program I am writing, because I have been using a school laptop while in class and haven't used my personal laptop. It is a really simple program, but I still can't run it because the pygame setup I downloaded isn't working. When I type "import pygame" into the shell it works, but when I try something like "from livewires import games" it says that the module livewires cannot be found. I am using Python3.1.1 but I also have Python3.4.3 installed. PLEASE HELP and thank you in advance.

E. Ingraham
  • 73
  • 1
  • 2
  • 6

3 Answers3

1

I'm fairly new to this too and I have Python 3.2 installed and found livewires would not work. I found a link to superwires: https://pypi.python.org/pypi/SuperWires/0.9.6

I unpacked that tar file and then copied the superwires folder into the Python32/Lib folder on my windows machine and ran my test program (changing from livewires import games to from superwires import games) and it worked!

0

According to this link, there is no version of livewires for python 3. From my experience, livewires is also a rather clunky library. I (and the linked thread) recommend using pygame or tikinter for your GUI needs in python 3.

Edit: While I have not changed my opinion that you should use Pygame or Tkinter, I have found the source code for the book at this link which includes the source code for all the examples in the book as well as the libraries used, including livewires.

Chathan Driehuys
  • 1,173
  • 3
  • 14
  • 28
  • I got all the installations from my textbook, "Python Programming for the Absolute Beginner, third edition" which is designed for python 3. my professor is also using the exact same installation with Python3.1.1. Any thoughts? – E. Ingraham Dec 06 '15 at 23:17
  • This guy: http://stackoverflow.com/questions/29781392/python-programming-for-the-absolute-beginner-livewires-is-not-working had the exact same problem I am having, but the answer doesn't make any sense to me.....I am completely new to all this stuff. Can anybody explain what all that stuff means, and will it even work on Windows 10? Or does anybody have another way that they got it to work?? – E. Ingraham Dec 06 '15 at 23:22
  • I did a little more digging and added more information to my post. Hope it helps. – Chathan Driehuys Dec 06 '15 at 23:23
  • where**. With that download it gives you pygame and everything you need to complete the assignments in the book, one of which is due tomorrow for me, but the livewires is the only one not working. I agree that pygame or tkinter would be easier/work better but my teacher will mark points off for not writing the program the way he is teaching. – E. Ingraham Dec 06 '15 at 23:26
  • What os are you using? I just installed livewires on Ubuntu using the provided `setup.py` file – Chathan Driehuys Dec 06 '15 at 23:30
  • What is an os?? and I tried to run the "setup.py" file but it closed immediately. – E. Ingraham Dec 06 '15 at 23:34
  • Are you on a windows, mac, or linux machine. – Chathan Driehuys Dec 06 '15 at 23:36
  • i am running windows 10 – E. Ingraham Dec 06 '15 at 23:38
  • I just opened a command prompt in the directory where the `setup.py` file is, ran `python setup.py`, and then successfully imported livewires. How are you trying to run the setup file? – Chathan Driehuys Dec 06 '15 at 23:45
  • i've just been double-clicking it in the "livewires" folder that comes with the installation off the website. my dad tried messing with command prompt, but neither of us really know what we are doing there. how did you run it? – E. Ingraham Dec 06 '15 at 23:57
  • open a command prompt, then `cd` into the livewires directory. Example: `cd \Users\Ingraham\Downloads\py3e_software\livewires` Then run `python setup.py` – Chathan Driehuys Dec 07 '15 at 00:00
  • i copied that into a command prompt, changed "Ingraham" to the correct name, but it said the system cannot find the path specified. – E. Ingraham Dec 07 '15 at 00:08
  • What's the path to the livewires folder you downloaded? – Chathan Driehuys Dec 07 '15 at 00:12
  • This PC>Downloads>py3e_software.zip – E. Ingraham Dec 07 '15 at 00:14
  • First you need to extract the files from py3e_software.zip Then navigate to wherever you extracted the files and find the `setup.py` file in the livewires folder. Right click on the file and select properties. In the pop-up, you will see a line that looks like `Location: C:\Users\Ingraham\Path\To\File`. In command prompt, run `python "\Users\Ingraham\Path\To\File"`. Notice that the drive (`C:`) is stripped from the command. – Chathan Driehuys Dec 07 '15 at 00:20
  • it says that "python is not recognized as an internal or external command, operable program, or batch file." – E. Ingraham Dec 07 '15 at 00:31
  • How did you install python? Did you run the installer from [here](https://www.python.org/downloads/release/python-350/)? – Chathan Driehuys Dec 07 '15 at 00:37
  • well i've been using a newer version (Python3.4.3) but when i did this i did run the installer from here because I figured I would need the same version the author is using – E. Ingraham Dec 07 '15 at 00:39
  • so i did install 3.4.3 from that website, but 3.1.1 i downloaded from the installer that came with the download for pygame and livewires – E. Ingraham Dec 07 '15 at 01:03
  • we got the .bat file to open all the way without error, and the .py file opens, but it said that it was installing livewires into 3.4.3, so now we have pygame in 3.1.1 and livewires in 3.4.3. so i uninstalled 3.4.3 and am now trying to get livewires into it. its now saying that i can't open that kind of file with any programs on my computer. so it's like half of the installation stuff they give you is for 3.4 and half for 3.1! i think it's just a corrupt file or something. – E. Ingraham Dec 07 '15 at 02:10
0

For python3 this works for me:

  1. First you need to install pip module (it will help to install livewires in last step)

sudo apt install python3-pip

  1. Install pygame module which is required for livewires

sudo apt install python3-pygame

  1. And at last install needed module

pip3 install livewires

  1. But most likely livewires will not work well, as it isn't working for me. So you can use updated version - superwires. Installation is almost the same:

pip3 install superwires

And just use superwires instead of livewires in your instructions.

Note, that this didn't work for me:

sudo apt install python3-livewires

with error: E: Unable to locate package python3-livewires

A. Denis
  • 562
  • 7
  • 15