Jump to content


Photo

Chapter 2 Page 41


  • Please log in to reply
8 replies to this topic

#1 paulocezar

paulocezar

    New Member

  • Members
  • Pip
  • 4 posts

Posted 26 July 2013 - 05:16 PM

Hi!
I had a problem in page 41 when I put the command C:\Python31\python.exe setup.py sdist it's gives me an error " can't open file 'setup.py': [Errno 2] No such file or directory, I'm using a windows 7, please if someone know how to resolve this problem please answer this post cause I don't wanna move on with this problem

#2 feros

feros

    New Member

  • Members
  • Pip
  • 4 posts

Posted 29 July 2013 - 07:35 AM

I'm having the same problem and partially solved it. For the setup.py file you need to call it in whatever folder it's in. I'm still having trouble with the sdist command and have a very incomplete distribution file. I also don't know how to install the distribution.

You can see what I did in my post here.

My link

I wonder if the instructions on this part are horrible for other OS's or just for windows.

Edited by feros, 29 July 2013 - 07:36 AM.


#3 paulocezar

paulocezar

    New Member

  • Members
  • Pip
  • 4 posts

Posted 30 July 2013 - 04:48 AM

I did the distribution but when I tried to install I received this message

#4 paulocezar

paulocezar

    New Member

  • Members
  • Pip
  • 4 posts

Posted 30 July 2013 - 05:00 AM

The problem is that when I tried to install it's say that " file nester.py (for module nester) noto found, running install_lib, warning: install_lib: 'build\lib' does not exist -- no Python modules to install

#5 paulbarry

paulbarry

    Advanced Member

  • O'Reilly Author
  • PipPipPipPipPipPipPipPip
  • 307 posts

Posted 30 July 2013 - 07:14 AM

Hi folks.

I'm running Windows 7 (64 bit) as well as Python 3.3.2 (64 bit). I've tested all of what follows and it works fine. :-)

I've put the code from chapter 2 is in a directory/folder called c:\nester (although it could be named anything). I've two files in there:

nester.py (from the book - top of page 40), and
setup.py (also from the book - bottom of page 41).

I then issue these commands (from the Windows CMD.EXE prompt) to install the module into Python.

cd \nester
c:\python33\python.exe setup.py sdist
c:\python33\python.exe setup.py install

These commands create, then install, the nester module into Python. A file called "MANIFEST", as well as three directories/folders called "dist", "build" and "__pycache__", are created, too. This differs a little bit from what's on page 42 in the book (as the details of this mechanism have changed since publication).

Of the three commands, above, the first is the most important. If you are not in the directory/folder that contains your code (in nester.py and setup.py), then the distribution tools can find them and you'll see the errors that you have been seeing.

Hope this helps.

Regards.

--Paul.

#6 paulocezar

paulocezar

    New Member

  • Members
  • Pip
  • 4 posts

Posted 31 July 2013 - 04:51 AM

Hi
Can anyone teach me how to insert a image so gonna be better to you see what happening here

#7 paulbarry

paulbarry

    Advanced Member

  • O'Reilly Author
  • PipPipPipPipPipPipPipPip
  • 307 posts

Posted 01 August 2013 - 01:00 AM

When entering your message, click the "browse" button under the edit window to select and insert an image to attach. This should allow you to insert a graphic. See the attached graphic for more. Once you select the image, click the "Attach This File" button to upload the image (note: there is a size restriction).

On Windows, Alt+PrintScr should allow you to grab a screenshot (and put it in your clipboard - you can then paste it into any graphics program). cmd+Shift+4 does the same thing on a Mac.

--Paul.

Attached Thumbnails

  • insert-image.png


#8 David2.0

David2.0

    New Member

  • Members
  • Pip
  • 2 posts

Posted 18 March 2014 - 06:18 PM

I have been struggling with this for the past few days. At first I thought it was my install. But it has happen on several of my win 7 PC. When I run the c:\python33\python.exe setup.py sdist inside my nester folder. it does not creat the build directory. So when I run the install - it finishes with the warning that build\lib does not exist and no modules were loaded.

has anyone see this before
IMG.jpeg

Edited by David2.0, 18 March 2014 - 06:22 PM.


#9 Jerle10

Jerle10

    New Member

  • Members
  • Pip
  • 2 posts

Posted 28 June 2014 - 05:16 PM

I tried it this way and it worked

To create distribution file

At Command Prompt Window:
cd c:\Python34\nester
c:\Python34\nester>C:\Python34\python.exe setup.py sdist





Copied from command window

Microsoft Windows [Version 6.1.7601]
Copyright © 2009 Microsoft Corporation. All rights reserved.

c:\Python34\nester>C:\Python34\python.exe setup.py sdist
running sdist
running check
warning: sdist: manifest template 'MANIFEST.in' does not exist (using default fi
le list)

warning: sdist: standard file not found: should have one of README, README.txt

writing manifest file 'MANIFEST'
creating nester-1.0.0
making hard links in nester-1.0.0...
hard linking nester.py -> nester-1.0.0
hard linking setup.py -> nester-1.0.0
creating dist
creating 'dist\nester-1.0.0.zip' and adding 'nester-1.0.0' to it
adding 'nester-1.0.0\nester.py'
adding 'nester-1.0.0\PKG-INFO'
adding 'nester-1.0.0\setup.py'
removing 'nester-1.0.0' (and everything under it)

c:\Python34\nester>








Install distribution into local copy of Python
While still in the command window enter:

C:\Python34\python.exe setup.py install

Copied from command window
c:\Python34\nester>C:\Python34\python.exe setup.py install
running install
running build
running build_py
creating build
creating build\lib
copying nester.py -> build\lib
running install_lib
copying build\lib\nester.py -> C:\Python34\Lib\site-packages
byte-compiling C:\Python34\Lib\site-packages\nester.py to nester.cpython-34.pyc
running install_egg_info
Writing C:\Python34\Lib\site-packages\nester-1.0.0-py3.4.egg-info

c:\Python34\nester




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users