Author Topic: Stuck with Python problem  (Read 1894 times)

0 Members and 1 Guest are viewing this topic.

Offline MuffinsTopic starter

  • Contributor
  • Posts: 45
  • Country: za
Stuck with Python problem
« on: May 19, 2018, 06:15:54 am »
Hi Guys,

I'm trying to get ESP-Link onto an ESP12F. I'm a windows user and the process seems to favor users running linux and python.

I've been following the tutorial described on its github page:https://github.com/jeelabs/esp-link/blob/master/FLASHING.md

I get down to this point:
> git clone https://github.com/themadinventor/esptool.git
Cloning into 'esptool'...
remote: Counting objects: 268, done.
emote: Total 268 (delta 0), reused 0 (delta 0), pack-reused 268
Receiving objects: 100% (268/268), 99.66 KiB | 0 bytes/s, done.
Resolving deltas: 100% (142/142), done.
Checking connectivity... done.

(no problems up to this point)

> cd esptool

> python setup.py install

After which I get the error:
python: can't open file 'setup.py': [Errno 2] No such file or directory

However, the file is present in the directory! I have checked the path and it seems good. Admittedly I have run so far into the night on this one I barely know what I am doing. I've included an image in the attachments of my results.


 

Offline tpowell1830

  • Frequent Contributor
  • **
  • Posts: 863
  • Country: us
  • Peacefully retired from industry, active in life
Re: Stuck with Python problem
« Reply #1 on: May 19, 2018, 06:24:44 am »
try putting the full path in front of setup.py (C:\windows\system32\esptools\setup.py)
PEACE===>T
 

Offline MuffinsTopic starter

  • Contributor
  • Posts: 45
  • Country: za
Re: Stuck with Python problem
« Reply #2 on: May 19, 2018, 06:49:39 am »
I just tried, it gives the same error.
 

Offline tpowell1830

  • Frequent Contributor
  • **
  • Posts: 863
  • Country: us
  • Peacefully retired from industry, active in life
Re: Stuck with Python problem
« Reply #3 on: May 19, 2018, 07:03:19 am »
I just tried, it gives the same error.

what version of python do you have installed?
PEACE===>T
 

Offline filssavi

  • Frequent Contributor
  • **
  • Posts: 433
Re: Stuck with Python problem
« Reply #4 on: May 19, 2018, 07:04:07 am »
I know it seems dumb but have you made shure that the command prompt working directory is the same that contains your installation file?
 

Offline MuffinsTopic starter

  • Contributor
  • Posts: 45
  • Country: za
Re: Stuck with Python problem
« Reply #5 on: May 19, 2018, 07:19:49 am »
I have Python 3.6 installed.

filssavi, what is meant by command prompt working directory? 
 

Offline pyroesp

  • Regular Contributor
  • *
  • Posts: 180
  • Country: be
    • Nicolas Electronics
Re: Stuck with Python problem
« Reply #6 on: May 19, 2018, 07:45:41 am »
You need to execute those python commands inside the folder of your esptool git clone.
 

Offline emece67

  • Frequent Contributor
  • **
  • !
  • Posts: 614
  • Country: 00
Re: Stuck with Python problem
« Reply #7 on: May 19, 2018, 08:20:33 am »
.
« Last Edit: August 19, 2022, 01:49:24 pm by emece67 »
 

Offline MuffinsTopic starter

  • Contributor
  • Posts: 45
  • Country: za
Re: Stuck with Python problem
« Reply #8 on: May 19, 2018, 08:36:44 am »
To invoke it in the folder don't you include the path in the command?

C:\Windows\System32\esptool>python .\setup.py install

Also gives the same error.
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: Stuck with Python problem
« Reply #9 on: May 19, 2018, 08:50:55 am »
The whole procedure works as described in the FLASHING.md file.

There's a number of problems with your setup:
  • You are doing this as administrator, it's not needed here. Your regular user should never be an adm.
  • You are in a system protected directory "C:\Windows\System32\". You should not treat it as any old folder.

So:
  • Do this as a regular user
  • Move the git repo in a regular folder.

See the attached screenshots.
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline emece67

  • Frequent Contributor
  • **
  • !
  • Posts: 614
  • Country: 00
Re: Stuck with Python problem
« Reply #10 on: May 19, 2018, 08:52:26 am »
.
« Last Edit: August 19, 2022, 01:49:42 pm by emece67 »
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: Stuck with Python problem
« Reply #11 on: May 19, 2018, 08:55:32 am »
But, in what folder do you have the setup.py script? In C:\Windows\System32\esptool?
The OP cloned the whole thing in the System32 directory. This is a no-no.
As my screenshot shows, even if the file is there one cannot access it.

ETA:
The actual explanation of this is the so called "File System Redirector", that Windows 64 bits versions use to maintain backward compatibility with 32 bits executables.
The System32 directory on 64bits systems contains 64bits dlls, so any 32 bits executable would find itself using the wrongly sized dll.
With FSR, when a 32 bits exe opens anything located in the System32 dir it's redirected to SysWOW64, where the system 32 bits dll are located.
Python is distributed as a 32 bit application.
« Last Edit: May 19, 2018, 09:37:51 am by newbrain »
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline emece67

  • Frequent Contributor
  • **
  • !
  • Posts: 614
  • Country: 00
Re: Stuck with Python problem
« Reply #12 on: May 19, 2018, 08:58:41 am »
.
« Last Edit: August 19, 2022, 01:49:50 pm by emece67 »
 

Offline filssavi

  • Frequent Contributor
  • **
  • Posts: 433
Re: Stuck with Python problem
« Reply #13 on: May 19, 2018, 09:00:41 am »
Your working directory in this case is C:\

Running the setup from there is really ill advised (you are likely to incurr in further permissions problems) you usually run python from the directory the setup script is in
Also is there any reason why the setup/source folder is in system32 (again you are asking for permission problems to happen there) you usually keep that stuff in download the script will copy stuff where it needs to in order for stuff to work

It could also be a permissions problem since in recent windows releases the OS prevents even admin user to touch stuff in system32

What I would do is download the stuff again and run the installer from a sensible place (the downloads folder for example) and let python do the rest

To run it you go with the terminal/command prompt (by means of cd) to the exact folder you have the setup script in and then run python ./setup.py install
 

Offline MuffinsTopic starter

  • Contributor
  • Posts: 45
  • Country: za
Re: Stuck with Python problem
« Reply #14 on: May 19, 2018, 07:57:02 pm »
Thanks guys, I installed the ESPtool to a directory outside of system32 and was able to run it.

I appreciate your input.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf