Python problem - no setup.py

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Pi B+

I've bought a DHT22 thermometer/humidity reader, as much as anything to  
see how well it works.

I've found a few references online on how to set it up, and they seem to  
be consistent with each other, but my install of the software doesn't  
work.

I've downloaded the software from

https://github.com/adafruit/Adafruit_Python_DHT.git

I've run update and upgrade on my pi, and downloaded the relevant  
packages :

sudo apt-get install build-essential python-dev python-openssl

So far, so good, no errors reported.

However when I try to run

sudo python setup.py install

I get :

python: can't open file 'setup.py': [Errno 2] No such file or directory

A bit of digging on my Pi shows that there are a large number of  
setup.py files in /usr/lib/*, but they differ.  Does that matter, or do  
I need to use a specific one for this particular install ?

Thanks

Adrian
--  
To Reply :
replace "bulleid" with "adrian" - all mail to bulleid is rejected
We've slightly trimmed the long signature. Click to see the full one.
Re: Python problem - no setup.py
the following:

Quoted text here. Click to load it

    And where did you PUT the download?

Quoted text here. Click to load it

    Are you IN the directory containing the downloaded files? Which, BTW,
should probably NOT be a system directory.


--  
    Wulfraed                 Dennis Lee Bieber         AF6VN
     snipped-for-privacy@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

Re: Python problem - no setup.py
Quoted text here. Click to load it

The download is in $HOME (as recommended)

Quoted text here. Click to load it


Yes.

Running find on the pi finds many copies of setup.py, but they are all  
in /usr/lib, none of them are in $HOME.

Thanks

Adrian
--  
To Reply :
replace "bulleid" with "adrian" - all mail to bulleid is rejected
We've slightly trimmed the long signature. Click to see the full one.
Re: Python problem - no setup.py
On 13/05/2017 13:25, Adrian wrote:
Quoted text here. Click to load it
So how did you download the files?
Where exactly did you put the files, $HOME or $HOME/<some_directory>?
What files from the repo can you see?



Re: Python problem - no setup.py
writes

Quoted text here. Click to load it

by running :

git clone --bare https://github.com/adafruit/Adafruit_Python_DHT.git

Quoted text here. Click to load it
$HOME/Adafruit_Python_DHT

Quoted text here. Click to load it

drwxr-xr-x 4 pi pi 4096 May 13 11:34 refs
-rw-r--r-- 1 pi pi   73 May 13 11:34 description
drwxr-xr-x 2 pi pi 4096 May 13 11:34 info
drwxr-xr-x 2 pi pi 4096 May 13 11:34 hooks
drwxr-xr-x 2 pi pi 4096 May 13 11:34 branches
drwxr-xr-x 4 pi pi 4096 May 13 11:34 objects
-rw-r--r-- 1 pi pi  143 May 13 11:34 config
-rw-r--r-- 1 pi pi   85 May 13 11:34 packed-refs
-rw-r--r-- 1 pi pi   23 May 13 11:34 HEAD
Quoted text here. Click to load it

I think this is my first attempt at getting stuff from git, so it is  
quite likely that I've not downloaded enough stuff.

Thanks

Adrian
--  
To Reply :
replace "bulleid" with "adrian" - all mail to bulleid is rejected
We've slightly trimmed the long signature. Click to see the full one.
Re: Python problem - no setup.py
On 13/05/2017 16:36, Adrian wrote:
Quoted text here. Click to load it
I clicked on the git link in my browser and can see the following files:

.github
Adafruit_DHT
examples
source
.gitignore
LICENSE
README.md
ez_setup.py
setup.py

I clicked the download zip and unzipping that has the files. I did your  
git command and got the same but I don't use git enough to know what is  
happening.

Re: Python problem - no setup.py
writes
Quoted text here. Click to load it


Very strange.  I don't know why, but I can download the stuff directly  
using a browser on my Pi (nothing happens), so I've downloaded the zip  
file on another machine and copied it across.  That worked !.

I've now got the software installed and it works (the temperature even  
looks about right).

Thanks

Adrian
--  
To Reply :
replace "bulleid" with "adrian" - all mail to bulleid is rejected
We've slightly trimmed the long signature. Click to see the full one.
Re: Python problem - no setup.py
Quoted text here. Click to load it

That's your problem.  Remove the --bare and try again.  You should end
up with the files in a directory called Adafruit_Python_DHT (no
".git")

git clone --bare creates a "bare" git repository that only has the
version control system files in it and doesn't have a working tree.

--  
Stephen Early
--  

Re: Python problem - no setup.py

Quoted text here. Click to load it

When you download, or better, clone the Adafruit_Python_DHT package:

        git clone snipped-for-privacy@github.com:adafruit/Adafruit_Python_DHT.git

it will create a directory called Adafruit_Python_DHT on your machine.

You have to be *in* that directory to run the setup.py, because you need
to run the setup.py that belongs to that package.

Note that https://github.com/adafruit/Adafruit_Python_DHT says you don't
need to use sudo if you're using a Pi.

Optionally, I would set this up in a virtual environment, so the Python
software you install is isolated.

Inside the Adafruit_Python_DHT directory, create a virtualenv called
"env":

        virtualenv env

Activate it:

        source env/bin/activate

And now run setup.py.

Now the Python libraries you have installed will be available whenever
you are in an environment (a terminal session for example) in which you
have activated the virtualenv.

Daniele

Re: Python problem - no setup.py
In message  
Quoted text here. Click to load it


Thanks, that's a new one on me, I'll have to do a bit more reading.

Adrian
--  
To Reply :
replace "bulleid" with "adrian" - all mail to bulleid is rejected
We've slightly trimmed the long signature. Click to see the full one.
Re: Python problem - no setup.py

Quoted text here. Click to load it


Try
<https://dont-be-afraid-to-commit.readthedocs.io/en/latest/virtualenv.html ,
which is aimed at beginners.

Daniele

Site Timeline