简体   繁体   中英

Python: Setup.py doesn't copy code to site-packages

I wrote my own python package and when I try to install with:

python setup.py install

It installs the package and puts an egg file in site-packages folder, but the code stays in the original folder (on my desktop) instead of moving to site-packages too. The setup.py script looks like this:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from setuptools import setup
from mypackage import __version__

setup(
    name  =  'mypackage',
    packages = ['mypackage'],
    version = __version__
)

The folder of the package looks like this:

setup.py
mypackage/
         __init__.py
         mymodule.py

How can I get it to copy the package to site-package like it normally does?

No need. That egg file is a single file importable distribution format containing your code. You should be able to import it as is.

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