Python Forum
pip - how to use it? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Game Development (https://python-forum.io/forum-11.html)
+--- Thread: pip - how to use it? (/thread-3851.html)



pip - how to use it? - amgp - Jun-30-2017

Purchased a book on Python Game Programming and got stuck after chapter 1.
At the start of chapter 2 i was told to type in: $pip --version and also $pip install cocos2d
I tried entering both of those commands in Python IDLE, and in the various Python folders using windows command prompt.
In all cases I met with failure.
Any ideas from anyonee?


RE: pip - how to use it? - snippsat - Jun-30-2017

Take a look  at Python 3.6 and pip installation under Windows,
Python environment Windows


RE: pip - how to use it? - metulburr - Jun-30-2017

(Jun-30-2017, 06:05 AM)amgp Wrote: At the start of chapter 2 i was told to type in: $pip --version and also $pip install cocos2d
I tried entering both of those commands in Python IDLE, and in the various Python folders using windows command prompt.
In all cases I met with failure.
first of all you dont put that command in the python. And IDLE is just a fancy text editor. You put that command into the system command prompt. Second of all the $ symbol is a prompt and is not part of the command.

Quote:In all cases I met with failure.
More info. Exactly what was failed? How? What did you input? What did that output? Make sure to follow snippsat's linked tutorial thats shows that python is in the PATH and pip is installed. After that, just type into your command prompt
pip install cocos2d



RE: pip - how to use it? - sparkz_alot - Jun-30-2017

Once you get pip working correctly, bear in mind you need to install 'pyglet' before you install 'cocos2d'.


RE: pip - how to use it? - metulburr - Jun-30-2017

(Jun-30-2017, 02:03 PM)sparkz_alot Wrote: Once you get pip working correctly, bear in mind you need to install 'pyglet' before you install 'cocos2d'.
i wasnt aware that pyglet was required for cocos2d


RE: pip - how to use it? - sparkz_alot - Jun-30-2017

(Jun-30-2017, 04:06 PM)metulburr Wrote: i wasnt aware that pyglet was required for cocos2d

I believe I'm reading this correctly cocos2d download, though it wouldn't be the first time I've been wrong  Tongue

EDIT:
This might be a better link, it shows other possible dependencies as well: cocos2d dependencies


RE: pip - how to use it? - Larz60+ - Jun-30-2017

You need go no further than pypi:

cocos2d:
Quote:Requirements

Software:

python 2.6, 2.7 or 3.3+
pyglet 1.2 or newer (http://www.pyglet.org)
Linux, Windows or Mac OS/X

Hardware:

To execute some effects you will need a video card with the:

GL_EXT_framebuffer_object extension.



RE: pip - how to use it? - snippsat - Jun-30-2017

(Jun-30-2017, 02:03 PM)sparkz_alot Wrote: bear in mind you need to install 'pyglet' before you install 'cocos2d'.
That's  requirement is written in setup.py
install_requires.append('pyglet>=1.2')
Additional dependencies that can be needed like numpy,Avibin,Pygame is not in setup.py.

I have a plain to write a tutorial about Packaging/Modules/setup.py and all that stuff.
Have started to think of how to do it Undecided

So if install cocos2d with pip 9.0.1 and Python 3.6.
It look like this.
C:\
λ pip install cocos2d
Collecting cocos2d
 Downloading cocos2d-0.6.4.zip (5.2MB)
   100% |████████████████████████████████| 5.2MB 146kB/s
Requirement already satisfied: six>=1.4 in c:\python36\lib\site-packages (from cocos2d)
Collecting pyglet>=1.2 (from cocos2d)
 Using cached pyglet-1.2.4-py3-none-any.whl
Building wheels for collected packages: cocos2d
 Running setup.py bdist_wheel for cocos2d ... done
 Stored in directory: C:\Users\Tom\AppData\Local\pip\Cache\wheels\39\f2\61\a6540702af5bb7f2c4a8997acdfadf33a685efd9f7c47af48c
Successfully built cocos2d
Installing collected packages: pyglet, cocos2d
Successfully installed cocos2d-0.6.4 pyglet-1.2.4
Just as in additional info there is no need to download wheel from Gohlke.
with pip 9.0.1 and Python 3.6.
It will find wheel and use it
Earlier version pip and Python on Windows did not do that.
Example:
C:\
λ pip install numpy
Collecting numpy
 Downloading numpy-1.13.0-cp36-none-win32.whl (6.8MB)
   100% |████████████████████████████████| 6.8MB 121kB/s
Installing collected packages: numpy
Successfully installed numpy-1.13.0
C:\
λ pip install pygame
Collecting pygame
 Downloading pygame-1.9.3-cp36-cp36m-win32.whl (4.0MB)
   100% |████████████████████████████████| 4.0MB 187kB/s
Installing collected packages: pygame
Successfully installed pygame-1.9.3



RE: pip - how to use it? - sparkz_alot - Jun-30-2017

(Jun-30-2017, 08:17 PM)snippsat Wrote: I have a plain to write a tutorial about Packaging/Modules/setup.py and all that stuff.
Have started to think of how to do it

Look forward to it


RE: pip - how to use it? - Larz60+ - Jul-01-2017

Quote:I have a plain to write a tutorial about Packaging/Modules/setup.py and all that stuff.
Have started to think of how to do it Undecided
I look forward to it as well. This is an area where I am weak.