When i do
python setup.py bdist
for my python project folder.I find that it creates the dist, build folder but after it creates the egg/tar it deletes the binary.
How do i keep the binary files? I can see that it removes the build folder at the end.
running bdist
running bdist_dumb
running build
running build_py
creating build
creating build/lib
creating build/lib/my_project_folder
copying my_project_folder/__init__.py -> build/lib/my_project_folder
copying my_project_folder/my_script.py -> build/lib/my_project_folder
installing to build/bdist.linux-x86_64/dumb
running install
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/dumb
creating build/bdist.linux-x86_64/dumb/usr
creating build/bdist.linux-x86_64/dumb/usr/lib
creating build/bdist.linux-x86_64/dumb/usr/lib/python2.6
creating build/bdist.linux-x86_64/dumb/usr/lib/python2.6/site-packages
creating build/bdist.linux-x86_64/dumb/usr/lib/python2.6/site-packages/my_project_folder
copying build/lib/my_project_folder/__init__.py -> build/bdist.linux-x86_64/dumb/usr/lib/python2.6/site-packages/my_project_folder
copying build/lib/my_project_folder/my_script.py -> build/bdist.linux-
byte-compiling build/bdist.linux-x86_64/dumb/usr/lib/python2.6/site-packages/my_project_folder/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/dumb/usr/lib/python2.6/site-packages/my_project_folder/my_script.py to my_script.pyc
running install_egg_info
running egg_info
creating my_project_folder.egg-info
writing requirements to my_project_folder.egg-info/requires.txt
writing my_project_folder.egg-info/PKG-INFO
writing top-level names to my_project_folder.egg-info/top_level.txt
writing dependency_links to my_project_folder.egg-info/dependency_links.txt
writing requirements to my_project_folder.egg-info/requires.txt
writing my_project_folder.egg-info/PKG-INFO
writing top-level names to my_project_folder.egg-info/top_level.txt
writing dependency_links to my_project_folder.egg-info/dependency_links.txt
writing manifest file 'my_project_folder.egg-info/SOURCES.txt'
reading manifest file 'my_project_folder.egg-info/SOURCES.txt'
writing manifest file 'my_project_folder.egg-info/SOURCES.txt'
Copying my_project_folder.egg-info to build/bdist.linux-x86_64/dumb/usr/lib/python2.6/site-packages/my_project_folder-1.0.0_SNAPSHOT-py2.6.egg-info
running install_scripts
creating /root/workspace/my_project-rpm/my_project-v1/target/my_project-v1-1.0.0-SNAPSHOT/dist
tar -cf /root/workspace/my_project-rpm/my_project-v1/target/my_project-v1-1.0.0-SNAPSHOT/dist/my_project-v1-1.0.0-SNAPSHOT.linux-x86_64.tar .
gzip -f9 /root/workspace/my_project-rpm/my_project-v1/target/my_project-v1-1.0.0-SNAPSHOT/dist/my_project-v1-1.0.0-SNAPSHOT.linux-x86_64.tar
tar -cf /root/workspace/my_project-rpm/my_project-v1/target/my_project-v1-1.0.0-SNAPSHOT/dist/my_project-v1-1.0.0-SNAPSHOT.linux-x86_64.tar .
gzip -f9 /root/workspace/my_project-rpm/my_project-v1/target/my_project-v1-1.0.0-SNAPSHOT/dist/my_project-v1-1.0.0-SNAPSHOT.linux-x86_64.tar
removing 'build/bdist.linux-x86_64/dumb' (and everything under it)
The problem i am trying to solve is to create a tar file of ONLY the binaries.
As of now able I am able to create the tar file with both *.py and *.pyc files(this comes by default with bdist command) I understand this is the feature of bdist command.
But i dont want the .py file in the end tar.
As long as i can get the access to the *.pyc files i can create the tar myself but setuptools doesnt let me keep it.
do both.
python setup.py bdist build
or
python setup.py bdist
python setup.py build
Related
I'm working on my Master's Thesis. My director uses MATLAB, I use Python. So I need to run his MATLAB scripts on Python. There are many questions out there on this topic.
I tried to install Install MATLAB Engine API for Python (https://es.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html). I came across the following problem:
Error: MATLAB Engine for Python supports Python version 2.7, 3.7, 3.8, and 3.9, but your version of Python is 3.10
Which alternatives do I have?
Another doubt I have: I checked my Python version by
python3 --version
and I get as an output: Python 3.9.7. I don't understand the Error then.
For the record, I'm using Ubuntu and Anaconda.
At the end, I get it working. Here's how:
HOW TO INSTALL MATLAB Engine API for Python.
Short Answer:
cd "matlabroot"\extern\engines\python
sudo \path_to_compatible_Python_version setup.py install
Long Answer:
You need Matlab correctly installed (I will skip this step)
Find the matlabroot (where is your Matlab installed). In Matlab's Command Window, type:
matlabroot
the ans is 'your matlabroot'. In my case, it is: '/usr/local/MATLAB/R2022a'
Open a terminal and type:
cd "matlabroot/extern/engines/python"
Just remember to change 'matlabroot' with 'your matlabroot' (i.e. output in step 2)
Run setup.py. 2 ways:
4.1 You can try: (it didn't work for me, but it is recommended in Install MATLAB Engine API for Python
python setup.py install
4.2 If you get the error:
error: could not create 'build': Permission denied
try to run it with sudo:
sudo python3 setup.py install
(I changed 'python' by 'python3')
Then you may get the version Error. It's something like:
EnvironmentError('MATLAB Engine for Python supports Python version')
OSError: MATLAB Engine for Python supports Python version [···], but your version of Python is [···].
You can check your Python with python -V
There is a chance you have more than one version of Python installed. You must make sure to use the direct path to the python.exe you want rather than the shortcut python3.
Let's do it. You can type into the terminal
which python.
This give use where python3 is located. (e.g. I get /home/user_name/anaconda3/bin/python3)
Go to the directory /home/user_name/anaconda3/bin (we omited python3 because this refers to a Symlink, not a directory)
There we should see (type ls) a symlink (word in Cyan) called python3
we can find the original file of a symbolic link by:
readlink -f python3
High are the chance, it is in the same directory (if not, go there). We need to search for a python version compatible with your matlab version. You can know that by the OSError or in Versions of Python Compatible with MATLAB Products by Releas
Type ls again in the same directory and search for a python compatible with your Matlab (green word). In my case, I found python3.9 and it works with my Matlab version.
Now, you have a compatible version of Python located, repeat step 3. Run setup.py but this time change python3 with the new python direction we just have found. In my case this look as follows:
sudo /home/user_name/anaconda3/bin/python3.9 setup.py install
All this worked for me. Good luck!
CU
To install matlab.engine on Ubuntu/Debian for python 3.9 and configure it with a conda environment, use the following procedure:
Activate your conda environment on the commandline
$ conda activate <your_amazing_conda_env>
Then, install matlab kernel
$ pip install matlab-kernel
Change to the matlab installation directory
$ cd /usr/local/MATLAB/R2022a/extern/engines/python
Install matlab.engine by directly pointing to location where your anaconda environment lives. For e.g.
$ sudo "/home/mario/anaconda3/envs/chamois/bin/python" setup.py install
Note that you need admin privileges in the last step.
If your installation is successful, you will get stack traces something like the following:
reading manifest file 'dist/matlabengineforpython.egg-info/SOURCES.txt'
writing manifest file 'dist/matlabengineforpython.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/matlab
copying build/lib/matlab/__init__.py -> build/bdist.linux-x86_64/egg/matlab
creating build/bdist.linux-x86_64/egg/matlab/engine
copying build/lib/matlab/engine/engineerror.py -> build/bdist.linux-x86_64/egg/matlab/engine
copying build/lib/matlab/engine/basefuture.py -> build/bdist.linux-x86_64/egg/matlab/engine
copying build/lib/matlab/engine/futureresult.py -> build/bdist.linux-x86_64/egg/matlab/engine
copying build/lib/matlab/engine/__init__.py -> build/bdist.linux-x86_64/egg/matlab/engine
copying build/lib/matlab/engine/_arch.txt -> build/bdist.linux-x86_64/egg/matlab/engine
copying build/lib/matlab/engine/enginehelper.py -> build/bdist.linux-x86_64/egg/matlab/engine
copying build/lib/matlab/engine/matlabfuture.py -> build/bdist.linux-x86_64/egg/matlab/engine
copying build/lib/matlab/engine/enginesession.py -> build/bdist.linux-x86_64/egg/matlab/engine
copying build/lib/matlab/engine/fevalfuture.py -> build/bdist.linux-x86_64/egg/matlab/engine
copying build/lib/matlab/engine/matlabengine.py -> build/bdist.linux-x86_64/egg/matlab/engine
byte-compiling build/bdist.linux-x86_64/egg/matlab/__init__.py to __init__.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/matlab/engine/engineerror.py to engineerror.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/matlab/engine/basefuture.py to basefuture.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/matlab/engine/futureresult.py to futureresult.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/matlab/engine/__init__.py to __init__.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/matlab/engine/enginehelper.py to enginehelper.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/matlab/engine/matlabfuture.py to matlabfuture.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/matlab/engine/enginesession.py to enginesession.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/matlab/engine/fevalfuture.py to fevalfuture.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/matlab/engine/matlabengine.py to matlabengine.cpython-39.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying dist/matlabengineforpython.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying dist/matlabengineforpython.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying dist/matlabengineforpython.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying dist/matlabengineforpython.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
matlab.__pycache__.__init__.cpython-39: module references __file__
matlab.__pycache__.__init__.cpython-39: module references __path__
matlab.engine.__pycache__.__init__.cpython-39: module references __file__
creating 'dist/matlabengineforpython-R2022a-py3.9.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing matlabengineforpython-R2022a-py3.9.egg
removing '/home/mario/anaconda3/envs/chamois/lib/python3.9/site-packages/matlabengineforpython-R2022a-py3.9.egg' (and everything under it)
creating /home/mario/anaconda3/envs/chamois/lib/python3.9/site-packages/matlabengineforpython-R2022a-py3.9.egg
Extracting matlabengineforpython-R2022a-py3.9.egg to /home/mario/anaconda3/envs/chamois/lib/python3.9/site-packages
matlabengineforpython R2022a is already the active version in easy-install.pth
Installed /home/mario/anaconda3/envs/chamois/lib/python3.9/site-packages/matlabengineforpython-R2022a-py3.9.egg
Processing dependencies for matlabengineforpython===R2022a
Finished processing dependencies for matlabengineforpython===R2022a
After that, you can test the working of the installation by importing matlab.engine in a python terminal.
In [1]: import matlab.engine
In [2]: matlab.engine.__spec__
Out[2]: ModuleSpec(name='matlab.engine', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7fe58c4514f0>, origin='/home/mario/anaconda3/envs/chamois/lib/python3.9/site-packages/matlabengineforpython-R2022a-py3.9.egg/matlab/engine/__init__.py', submodule_search_locations=['/home/mario/anaconda3/envs/chamois/lib/python3.9/site-packages/matlabengineforpython-R2022a-py3.9.egg/matlab/engine'])
In [3]: matlab.engine.__name__
Out[3]: 'matlab.engine'
In [4]: matlab.engine.__path__
Out[4]: ['/home/mario/anaconda3/envs/chamois/lib/python3.9/site-packages/matlabengineforpython-R2022a-py3.9.egg/matlab/engine']
I've worked on adding Python 3.5 type hints to the responses library. But when I test making a distribution, sdist or bdist_wheel, it doesn't install my .pyi file. I can see it being part of the distribution, but it doesn't go further than that.
You can see what I got in my repo here: https://github.com/gaqzi/responses/tree/feature/type-hints-file
I read PEP484 which mentions that stub files should be distributable. But I can't seem to figure out how. :)
Is there a problem because responses doesn't create a package? It's just a single module file and that's why it doesn't get added correctly?
What I see when I build the package:
% python setup.py sdist
running sdist
running egg_info
writing requirements to responses.egg-info/requires.txt
writing top-level names to responses.egg-info/top_level.txt
writing responses.egg-info/PKG-INFO
writing dependency_links to responses.egg-info/dependency_links.txt
reading manifest file 'responses.egg-info/SOURCES.txt'
writing manifest file 'responses.egg-info/SOURCES.txt'
running check
warning: check: missing meta-data: if 'author' supplied, 'author_email' must be supplied too
creating responses-0.6.0
creating responses-0.6.0/responses.egg-info
making hard links in responses-0.6.0...
hard linking README.rst -> responses-0.6.0
hard linking responses.py -> responses-0.6.0
hard linking responses.pyi -> responses-0.6.0
hard linking setup.cfg -> responses-0.6.0
hard linking setup.py -> responses-0.6.0
hard linking responses.egg-info/PKG-INFO -> responses-0.6.0/responses.egg-info
hard linking responses.egg-info/SOURCES.txt -> responses-0.6.0/responses.egg-info
hard linking responses.egg-info/dependency_links.txt -> responses-0.6.0/responses.egg-info
hard linking responses.egg-info/not-zip-safe -> responses-0.6.0/responses.egg-info
hard linking responses.egg-info/requires.txt -> responses-0.6.0/responses.egg-info
hard linking responses.egg-info/top_level.txt -> responses-0.6.0/responses.egg-info
copying setup.cfg -> responses-0.6.0
Writing responses-0.6.0/setup.cfg
Creating tar archive
removing 'responses-0.6.0' (and everything under it)
After I've installed the package I got this:
% pip install dist/responses-0.6.0.tar.gz
[...snip...]
Installing collected packages: responses
Successfully installed responses-0.6.0
% pwd
/Users/ba/.virtualenvs/responses/lib/python3.5/site-packages
% ls responses*
responses.py
responses-0.6.0.dist-info:
DESCRIPTION.rst METADATA RECORD WHEEL metadata.json top_level.txt
According to the mypy docs, you should pass package_data={"my_package": ["py.typed", "foo.pyi"]} as an argument to setup in setup.py. Note that "foo.pyi" is the relative path from the root of the package to be distributed to the
stub file (docs).
I've created an example repo where you can test this out at https://github.com/SKalt/stub_distrib_demo.
I run:
python3 setup.py bdist_wheel --universal
It says it's making all sorts of stuff, but then the resulting directory (build/bdist.macosx-10.10-x86_64) is empty. Where did my wheel roll away to?t
Edit
I now see that I'm trying to look at the temp output. When I specify -d, sure enough, there's a wheel in the designated location. Does -d have a default? Has my wheel been parked under my nose all along?
running bdist_wheel
running build
running build_py
running egg_info
writing dependency_links to rosapi_launcher.egg-info/dependency_links.txt
writing top-level names to rosapi_launcher.egg-info/top_level.txt
writing rosapi_launcher.egg-info/PKG-INFO
writing requirements to rosapi_launcher.egg-info/requires.txt
reading manifest file 'rosapi_launcher.egg-info/SOURCES.txt'
writing manifest file 'rosapi_launcher.egg-info/SOURCES.txt'
installing to build/bdist.macosx-10.10-x86_64/wheel
running install
running install_lib
creating build/bdist.macosx-10.10-x86_64/wheel
creating build/bdist.macosx-10.10-x86_64/wheel/launcher
copying build/lib/launcher/__init__.py -> build/bdist.macosx-10.10-x86_64/wheel/launcher
copying build/lib/launcher/containers.py -> build/bdist.macosx-10.10-x86_64/wheel/launcher
copying build/lib/launcher/launcher.py -> build/bdist.macosx-10.10-x86_64/wheel/launcher
copying build/lib/launcher/prop_file.py -> build/bdist.macosx-10.10-x86_64/wheel/launcher
copying build/lib/launcher/properties.py -> build/bdist.macosx-10.10-x86_64/wheel/launcher
copying build/lib/launcher/snapshots.py -> build/bdist.macosx-10.10-x86_64/wheel/launcher
copying build/lib/launcher/utils.py -> build/bdist.macosx-10.10-x86_64/wheel/launcher
running install_egg_info
Copying rosapi_launcher.egg-info to build/bdist.macosx-10.10-x86_64/wheel/rosapi_launcher-0.0.1-py3.4.egg-info
running install_scripts
creating build/bdist.macosx-10.10-x86_64/wheel/rosapi_launcher-0.0.1.dist-info/WHEEL
My setup.py is:
from setuptools import setup
import io
import os
import launcher
here = os.path.abspath(os.path.dirname(__file__))
# noinspection PyPackageRequirements
def read(*filenames, **kwargs):
encoding = kwargs.get('encoding', 'utf-8')
sep = kwargs.get('sep', '\n')
buf = []
for filename in filenames:
with io.open(filename, encoding=encoding) as f:
buf.append(f.read())
return sep.join(buf)
long_description = read('README.txt', 'CHANGES.txt')
setup(
name='rosapi-launcher',
version=launcher.__version__,
install_requires=['pyaml',
'boto3'
],
description='RosAPI launcher',
long_description=long_description,
packages=['launcher'],
include_package_data=True,
platforms='any',
classifiers = [
'Programming Language :: Python',
'Natural Language :: English'
]
)
The answer I found is this:
python3 setup.py bdist_wheel
doesn't write the results anyplace I can find them.
python3 setup.py bdist_wheel -d .
writes it, well, right here.
If I got you right, you search for resulting .whl file in ./build/... directory. But resulting files, both source distribution and wheel, usually by default get created in the ./dist/ directory, which is located near the build directory. Have you searched there?
A few days ago I was able to create a Windows executable of my package using py2exe with no trouble. Today I tried again after completing deleting the build/ and dist/ folders and I don't see any errors, but I also don't get an executable in my dist/ folder. I do get these files in dist/:
_hashlib.pyd
bz2.pyd
library.zip
python27.dll
select.pyd
unicodedata.pyd
Here's my setup.py file:
from setuptools import setup
import py2exe
setup (
name = "RabbitToRaven",
version = "0.1",
description="RabbitToRaven is a utility for copying RabbitMQ messages into a RavenDB database.",
author="Greg Major",
author_email="", # Removed to limit spam harvesting.
url="http://www.gregmajor.com/",
packages=['RabbitToRaven'],
entry_points = {
'console_scripts': ['RabbitToRaven = RabbitToRaven.__main__:main']
},
download_url = "http://www.gregmajor.com/",
zip_safe = True
)
If I run $ python setup.py build with export DISTUTILS_DEBUG=1 then I get this:
options (after parsing config files):
options (after parsing command line):
option dict for 'aliases' command:
{}
option dict for 'build' command:
{'verbose': ('command line', 1)}
running build
Distribution.get_command_obj(): creating 'build' command object
setting options for 'build' command:
verbose = 1 (from command line)
running build_py
Distribution.get_command_obj(): creating 'build_py' command object
creating build
creating build\lib
creating build\lib\RabbitToRaven
copying RabbitToRaven\__init__.py -> build\lib\RabbitToRaven
copying RabbitToRaven\__main__.py -> build\lib\RabbitToRaven
Here's my python setup.py py2exe output:
options (after parsing config files):
options (after parsing command line):
option dict for 'aliases' command:
{}
option dict for 'py2exe' command:
{}
running py2exe
Distribution.get_command_obj(): creating 'py2exe' command object
Distribution.get_command_obj(): creating 'bdist' command object
Distribution.get_command_obj(): creating 'build' command object
setting options for 'build' command:
running build_py
Distribution.get_command_obj(): creating 'build_py' command object
creating build
creating build\lib
creating build\lib\RabbitToRaven
copying RabbitToRaven\__init__.py -> build\lib\RabbitToRaven
copying RabbitToRaven\__main__.py -> build\lib\RabbitToRaven
creating c:\Users\Greg\Code\LeadPipe.RabbitToRaven\build\bdist.win-amd64
creating c:\Users\Greg\Code\LeadPipe.RabbitToRaven\build\bdist.win-amd64\winexe
creating c:\Users\Greg\Code\LeadPipe.RabbitToRaven\build\bdist.win-amd64\winexe\collect-2.7
creating c:\Users\Greg\Code\LeadPipe.RabbitToRaven\build\bdist.win-amd64\winexe\bundle-2.7
creating c:\Users\Greg\Code\LeadPipe.RabbitToRaven\build\bdist.win-amd64\winexe\temp
creating c:\Users\Greg\Code\LeadPipe.RabbitToRaven\dist
*** searching for required modules ***
*** parsing results ***
creating python loader for extension 'unicodedata' (C:\tools\python2\DLLs\unicodedata.pyd -> unicodedata.pyd)
creating python loader for extension 'select' (C:\tools\python2\DLLs\select.pyd -> select.pyd)
creating python loader for extension '_hashlib' (C:\tools\python2\DLLs\_hashlib.pyd -> _hashlib.pyd)
creating python loader for extension 'bz2' (C:\tools\python2\DLLs\bz2.pyd -> bz2.pyd)
*** finding dlls needed ***
*** create binaries ***
*** byte compile python files ***
byte-compiling C:\tools\python2\Lib\StringIO.py to StringIO.pyc
snip!!!
byte-compiling c:\Users\Greg\Code\LeadPipe.RabbitToRaven\lib\warnings.py to warnings.pyc
*** copy extensions ***
copying C:\tools\python2\DLLs\_hashlib.pyd -> c:\Users\Greg\Code\LeadPipe.RabbitToRaven\dist
copying C:\tools\python2\DLLs\bz2.pyd -> c:\Users\Greg\Code\LeadPipe.RabbitToRaven\dist
copying C:\tools\python2\DLLs\select.pyd -> c:\Users\Greg\Code\LeadPipe.RabbitToRaven\dist
copying C:\tools\python2\DLLs\unicodedata.pyd -> c:\Users\Greg\Code\LeadPipe.RabbitToRaven\dist
*** copy dlls ***
copying C:\Windows\system32\python27.dll -> c:\Users\Greg\Code\LeadPipe.RabbitToRaven\dist
setting sys.winver for 'c:\Users\Greg\Code\LeadPipe.RabbitToRaven\dist\python27.dll' to 'RabbitToRaven'
*** binary dependencies ***
Your executable(s) also depend on these dlls which are not included,
you may or may not need to distribute them.
Make sure you have the license if you distribute any of them, and
make sure you don't distribute files belonging to the operating system.
USER32.dll - C:\Windows\system32\USER32.dll
SHELL32.dll - C:\Windows\system32\SHELL32.dll
ADVAPI32.dll - C:\Windows\system32\ADVAPI32.dll
WS2_32.dll - C:\Windows\system32\WS2_32.dll
GDI32.dll - C:\Windows\system32\GDI32.dll
KERNEL32.dll - C:\Windows\system32\KERNEL32.dll
Anybody have an idea? I'm pretty new to py2exe so I'm sure it's probably just a silly oversight. For what it's worth, my virtualenv environment is activated and I'm building from a Bash for Git terminal (although cmd.exe doesn't work either).
You aren't specifying which file should be made into an executable. Or at least not in a way that py2exe understands. entry_points and console_scripts seem to be options unique to setuptools.
Add either
console=['name_of_script.py']
or
windows=['name_of_script.py']
as a parameter to your setup() function inside the setup.py file. Depending on if you're creating a console or GUI application. These need to be lists, even if you're specifying only a single python script, although you can add more if you'd like.
Assuming you're creating a console application, your setup function should look something like this.
setup (
name = "RabbitToRaven",
version = "0.1",
console = ['name_of_script.py'],
...)
See http://www.py2exe.org/index.cgi/ListOfOptions for all the py2exe options.
I am trying to release software through pypi, and while pip can search for the library, it is unable to download the library.
I suspect it is an issue with the setup.py file,
doclines = __doc__.split("\n")
with open('requirements.txt') as f:
required = f.read().splitlines()
setup(
name='Directory_Caching',
packages=find_packages(),
version='1.0.6',
description = doclines[0],
long_description = "\n".join(doclines[2:]),
author='Benjamin Schollnick',
author_email='benjamin#schollnick.net',
license="MIT",
maintainer='Benjamin Schollnick',
maintainer_email='benjamin#schollnick.net',
platforms=["Any"],
url='https://github.com/bschollnick/Directory_Caching',
download_url = 'https://github.com/bschollnick/Directory_Caching/tarball/1.05',
#install_requires=required,
#requires=required,
keywords = ['caching', 'files', 'directories', 'scandir', 'naturalsort'],
classifiers=filter(None, classifiers.split("\n")),
)
Pypitest is accepting the file fine, via register, and the sdist upload is working fine.
-- Register
nerv:Directory_caching Benjamin$ python setup.py register -r pypitest
running register
running egg_info
deleting Directory_Caching.egg-info/requires.txt
writing Directory_Caching.egg-info/PKG-INFO
writing top-level names to Directory_Caching.egg-info/top_level.txt
writing dependency_links to Directory_Caching.egg-info/dependency_links.txt
reading manifest file 'Directory_Caching.egg-info/SOURCES.txt'
writing manifest file 'Directory_Caching.egg-info/SOURCES.txt'
running check
Registering Directory_Caching to https://testpypi.python.org/pypi
Server response (200): OK
nerv:Directory_caching Benjamin$ python setup.py sdist upload -r pypitest
running sdist
running egg_info
writing Directory_Caching.egg-info/PKG-INFO
writing top-level names to Directory_Caching.egg-info/top_level.txt
writing dependency_links to Directory_Caching.egg-info/dependency_links.txt
reading manifest file 'Directory_Caching.egg-info/SOURCES.txt'
writing manifest file 'Directory_Caching.egg-info/SOURCES.txt'
warning: sdist: standard file not found: should have one of README, README.rst, README.txt
running check
creating Directory_Caching-1.0.503
creating Directory_Caching-1.0.503/Directory_Caching
creating Directory_Caching-1.0.503/Directory_Caching.egg-info
making hard links in Directory_Caching-1.0.503...
hard linking setup.cfg -> Directory_Caching-1.0.503
hard linking setup.py -> Directory_Caching-1.0.503
hard linking Directory_Caching/__init__.py -> Directory_Caching-1.0.503/Directory_Caching
hard linking Directory_Caching/directory_caching.py -> Directory_Caching-1.0.503/Directory_Caching
hard linking Directory_Caching.egg-info/PKG-INFO -> Directory_Caching-1.0.503/Directory_Caching.egg-info
hard linking Directory_Caching.egg-info/SOURCES.txt -> Directory_Caching-1.0.503/Directory_Caching.egg-info
hard linking Directory_Caching.egg-info/dependency_links.txt -> Directory_Caching-1.0.503/Directory_Caching.egg-info
hard linking Directory_Caching.egg-info/top_level.txt -> Directory_Caching-1.0.503/Directory_Caching.egg-info
copying setup.cfg -> Directory_Caching-1.0.503
Writing Directory_Caching-1.0.503/setup.cfg
Creating tar archive
removing 'Directory_Caching-1.0.503' (and everything under it)
running upload
Submitting dist/Directory_Caching-1.0.503.tar.gz to https://testpypi.python.org/pypi
Server response (200): OK
nerv:Directory_caching Benjamin$ python setup.py register -r pypitest
running register
running egg_info
writing Directory_Caching.egg-info/PKG-INFO
writing top-level names to Directory_Caching.egg-info/top_level.txt
writing dependency_links to Directory_Caching.egg-info/dependency_links.txt
reading manifest file 'Directory_Caching.egg-info/SOURCES.txt'
writing manifest file 'Directory_Caching.egg-info/SOURCES.txt'
running check
Registering Directory_Caching to https://testpypi.python.org/pypi
Server response (200): OK
upload
nerv:Directory_caching Benjamin$ python setup.py sdist upload -r pypitest
running sdist
running egg_info
writing Directory_Caching.egg-info/PKG-INFO
writing top-level names to Directory_Caching.egg-info/top_level.txt
writing dependency_links to Directory_Caching.egg-info/dependency_links.txt
reading manifest file 'Directory_Caching.egg-info/SOURCES.txt'
writing manifest file 'Directory_Caching.egg-info/SOURCES.txt'
warning: sdist: standard file not found: should have one of README, README.rst, README.txt
running check
creating Directory_Caching-1.0.504
creating Directory_Caching-1.0.504/Directory_Caching
creating Directory_Caching-1.0.504/Directory_Caching.egg-info
making hard links in Directory_Caching-1.0.504...
hard linking setup.cfg -> Directory_Caching-1.0.504
hard linking setup.py -> Directory_Caching-1.0.504
hard linking Directory_Caching/__init__.py -> Directory_Caching-1.0.504/Directory_Caching
hard linking Directory_Caching/directory_caching.py -> Directory_Caching-1.0.504/Directory_Caching
hard linking Directory_Caching.egg-info/PKG-INFO -> Directory_Caching-1.0.504/Directory_Caching.egg-info
hard linking Directory_Caching.egg-info/SOURCES.txt -> Directory_Caching-1.0.504/Directory_Caching.egg-info
hard linking Directory_Caching.egg-info/dependency_links.txt -> Directory_Caching-1.0.504/Directory_Caching.egg-info
hard linking Directory_Caching.egg-info/top_level.txt -> Directory_Caching-1.0.504/Directory_Caching.egg-info
copying setup.cfg -> Directory_Caching-1.0.504
Writing Directory_Caching-1.0.504/setup.cfg
Creating tar archive
removing 'Directory_Caching-1.0.504' (and everything under it)
running upload
Submitting dist/Directory_Caching-1.0.504.tar.gz to https://testpypi.python.org/pypi
Server response (200): OK
If I run a verbose run on pip, the following errors appear to be the problem?
Skipping link https://testpypi.python.org/pypi/Directory_Caching/1.0.504 (from https://testpypi.python.org/pypi/Directory_Caching); unknown archive format: .504
Skipping link https://testpypi.python.org/pypi/Directory_Caching/1.0.503 (from https://testpypi.python.org/pypi/Directory_Caching); unknown archive format: .503
Skipping link https://testpypi.python.org/pypi/Directory_Caching/1.0.502 (from https://testpypi.python.org/pypi/Directory_Caching); unknown archive format: .502
Skipping link https://testpypi.python.org/pypi/Directory_Caching/1.0.501 (from https://testpypi.python.org/pypi/Directory_Caching); unknown archive format: .501
Skipping link https://testpypi.python.org/pypi/Directory_Caching/1.0.51 (from https://testpypi.python.org/pypi/Directory_Caching); unknown archive format: .51
Skipping link https://testpypi.python.org/pypi/Directory_Caching/1.0.5 (from https://testpypi.python.org/pypi/Directory_Caching); unknown archive format: .5
I have setup tags at Github (https://github.com/bschollnick/Directory_Caching), and using the links in pypi or pypi test appear to work fine. Any suggestions?
I'm not sure, this the basic setup i use though with no problem.
import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = 'name',
packages = ['package'],
version = '1.0.0',
author = 'your name',
author_email = 'some_email#gmail.com',
url = 'github',
download_url = 'git download link',
keywords = ['keywords'],
description = 'short description',
long_description = read('README.txt'),
classifiers = [],
)