简体   繁体   中英

pip install virtualenv where are the scripts

This is probably an incredibly stupid question, but I'm testing out a python package that I wrote that has some scripts.

I did the following sequence:

  1. created a distribution using setup.py
  2. created a virtual environment using virtualenv,
  3. called "activate.bat"
  4. installed my package using pip (by giving the path to the .zip file) Things seemed to work, except that I have no idea how to run my scripts. If I try to run example.py, I get the message (I'm using Windows):

'example.py' is not recognized as an internal or external command, operable program or batch file.

I don't see any evidence of this file residing anywhere, except in the original .zip file. So how do I run it?

[Update] I checked, and the script files are not in the virtual environment directory anywhere.

The setup.py file looks like this:

from distutils.core import setup

setup(name='Fixedwidth',
      version='1.0',
      description='Parser for fixed-width records',
      author='Daryl McCullough',
      author_email='dmccullough@decisionpatterns.com',
      package_dir={'fixedwidth':'lib'},
      packages=['fixedwidth', 'fixedwidth.profiling'],
      scripts=['test/example.py', 'test/unittest.py']
      )

Okay, this was, as I suspected, something completely stupid. I was getting confused between the two different "Scripts" directories, and I was running the wrong "pip", and the result was that it was installing the package into the main python directory, not the virtual environment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM