Stuck with Python problem - Page 1
Forum section: electronics / beginners

author: Muffins
author_rank: Regular Contributor
timestamp: May 19, 2018, 06:15:54 am
content: Hi Guys,I'm trying to getESP-Linkonto 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.mdI get down to this point:> git clonehttps://github.com/themadinventor/esptool.gitCloning into 'esptool'...remote: Counting objects: 268, done.emote: Total 268 (delta 0), reused 0 (delta 0), pack-reused 268Receiving 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 installAfter which I get the error:python: can't open file 'setup.py': [Errno 2] No such file or directoryHowever, 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.

author: tpowell1830
author_rank: Frequent Contributor
timestamp: May 19, 2018, 06:24:44 am
content: try putting the full path in front of setup.py (C:\windows\system32\esptools\setup.py)

author: Muffins
author_rank: Regular Contributor
timestamp: May 19, 2018, 06:49:39 am
content: I just tried, it gives the same error.

author: tpowell1830
author_rank: Frequent Contributor
timestamp: May 19, 2018, 07:03:19 am
content: Quote from: Muffins on May 19, 2018, 06:49:39 amwhat version of python do you have installed?

author: filssavi
author_rank: Frequent Contributor
timestamp: May 19, 2018, 07:04:07 am
content: I know it seems dumb but have you made shure that the command prompt working directory is the same that contains your installation file?

author: Muffins
author_rank: Regular Contributor
timestamp: May 19, 2018, 07:19:49 am
content: I have Python 3.6 installed.filssavi, what is meant by command prompt working directory?

author: pyroesp
author_rank: Regular Contributor
timestamp: May 19, 2018, 07:45:41 am
content: You need to execute those python commands inside the folder of your esptool git clone.

author: emece67
author_rank: Frequent Contributor
timestamp: May 19, 2018, 08:20:33 am
content: .

author: Muffins
author_rank: Regular Contributor
timestamp: May 19, 2018, 08:36:44 am
content: To invoke it in the folder don't you include the path in the command?C:\Windows\System32\esptool>python .\setup.py installAlso gives the same error.

author: newbrain
author_rank: Super Contributor
timestamp: May 19, 2018, 08:50:55 am
content: 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 userMove the git repo in a regular folder.See the attached screenshots.

author: emece67
author_rank: Frequent Contributor
timestamp: May 19, 2018, 08:52:26 am
content: .

author: newbrain
author_rank: Super Contributor
timestamp: May 19, 2018, 08:55:32 am
content: Quote from: emece67 on May 19, 2018, 08:52:26 amThe 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 directoryon 64bits systemscontains 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.

author: emece67
author_rank: Frequent Contributor
timestamp: May 19, 2018, 08:58:41 am
content: .

author: filssavi
author_rank: Frequent Contributor
timestamp: May 19, 2018, 09:00:41 am
content: 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 inAlso 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 workIt could also be a permissions problem since in recent windows releases the OS prevents even admin user to touch stuff in system32What 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 restTo 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

author: Muffins
author_rank: Regular Contributor
timestamp: May 19, 2018, 07:57:02 pm
content: Thanks guys, I installed the ESPtool to a directory outside of system32 and was able to run it.I appreciate your input.