I am using python3.4 on debian jessie After the following enties
from setuptools import setup
setup(
name='vseach',
version='1.0',
py_modules=['vsearch'],
)
Error:
error:no commands supplied
vsearch is a file in the current directory containing two function definitions.
I am just getting started with python and have found several instructions identical to the lines above. None specify a command..
Is there something I have missed?
From my limited knowledge it looks like all you have done is defined three variables, thus the 'no commands supplied' error.
Can you post links to some of the instructions you mentioned?
Here are a couple references
https://pythonhosted.org/an_example_pypi...tools.html
The setup in this reference is more elaborate but still no commands. If you scroll down there is a listing of possible commands. On my system the entry
setup --help-commands
does not work.
The following reference uses
from distutils import setup
and I have tried this too with the same results
https://docs.python.org/3/distutils/intr...le-example:
I had a third reference which I have misplaced. It used the minimal script exactly as in my original post but advised that a much more detailed version should be used.
For the first one did you do all this?
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
I entered the lines you suggested and python accepted them followed by the setup lines in my original post. The result was still
error: no commands supplied
My misunderstanding. The instructions meant to create a file setup.py with the contents
from setuptools import setup
setup(
name='vsearch',
version='1.0',
py_modules=['vsearch'],
)
in same the directory as
vsearch.py
which contains the function definitions.
Then from the system prompt run the command
python3.4 setup.py dist
This works and creates a sub directory dist containing the file
vsearch-1.0.tar.gz
Finally from the system prompt run:
python3.4 -m pip install vsearch-1.0.tar.gz
.
This last step does not work for me. The system responds /usr/bin/python3.4 No module named pip
My understanding is pip should be a part of python3.4.installation.
How can I fix this?
The link from mcmxl22 should get you pip.
You could also make
wheel,
which is a better format an more modern format for python.
pip install wheel
Then from command line:
python setup.py bdist_wheel
Now you should have
vsearch-1.0-py3-none-any.whl
Usage:
pip install vsearch-1.0-py3-none-any.whl
If want to share with the world,then upload to
PyPI
Then when finish it can eg be
pip install vsearch
(will download and install your module to user).