Hi @gitAnuj1234 ,
Thanks for reporting this issue. I think this might be a PATH issue with your install.
If you run «pip» as a normal user on Linux (ie pip install esptool rather than sudo pip install esptool then the esptool.py executable is installed to the directory ~/local/.bin directory (ie the hidden .local/bin directory inside your home directory).
In a default Ubuntu install, this directory is normally part of your user’s PATH (there’s a line in .profile which adds it). Maybe the .profile file or the PATH has been modified on your install.
Some workarounds, either of which should which should work:
- Run esptool.py as
~/.local/bin/esptool.py -p /dev/ttyUSB0 ... - Edit the
.profilefile in your home directory and look for a line like this:
# set PATH so it includes user's private bin directories
PATH="$HOME/bin:$HOME/.local/bin:$PATH"
… and add it if it’s not already there (note you have to log out of your session and back in before changes to .profile take effect).
-
mzimmers
- Posts: 643
- Joined: Wed Mar 07, 2018 11:54 pm
- Location: USA
(resolved) problem with esptool.py
Hi all —
Since migrating to V4 of the IDF (under Windows), I’ve run into an issue using esptool.py. Whereas I used to be able to run a command like this:
Code: Select all
C:esp32_projectswifibutton>esptool.py write_flash 0x9000 nvs_reuse.bin
I now have to do it like this:
Code: Select all
C:esp32_projectswifibutton>python C:esp32_toolchainpython_envidf4.0_py3.7_envLibsite-packagesesptool.py write_flash 0x9000 nvs_reuse.bin
Obviously not convenient. If I attempt to run it the old way, it’s as though the arguments aren’t getting passed through to the script. Did I miss a step in the installation, or is there some workaround I’m not aware of?
Thanks…
Last edited by mzimmers on Thu Dec 12, 2019 10:41 pm, edited 1 time in total.
-
ESP_Angus
- Posts: 2344
- Joined: Sun May 08, 2016 4:11 am
Re: problem with esptool.py
Postby ESP_Angus » Wed Dec 04, 2019 3:01 am
Hi mzimmers,
Are you using the IDF Command Prompt, or MSYS2, or something else?
The V4.0 Windows installer setups a Python virtualenv with a dedicated copy of Python and its own set of installed Python modules. If you run the IDF Command Prompt then you’ll be inside this Python environment.
The fact that there is a file «idf4.0_py3.7_envLibsite-packagesesptool.py» suggests that «pip install esptool» has been run while inside the virtualenv. This is not required by ESP-IDF but it’s fine, doesn’t harm anything (ESP-IDF will use the copy of esptool inside IDF_PATH/components/esptool_py/esptool).
If you’re using IDF Command Prompt, then because esptool was installed with pip in the virtualenv then you should be able to run «esptool.py write_flash 0x9000 nvs_reuse.bin» without needing anything else. If it doesn’t work in the virtualenv, try running «pip install esptool» again.
If you’re using a different command prompt, the solution may be different. Running «esptool.py» with the default Python environment (ie a normal Command Prompt) may work depending on how the Windows python installation is configured.
-
mzimmers
- Posts: 643
- Joined: Wed Mar 07, 2018 11:54 pm
- Location: USA
Re: problem with esptool.py
Postby mzimmers » Wed Dec 04, 2019 3:05 am
Hi Angus — yes, I am running the ESP-IDF Command Prompt. (I was using MYSYS2 when working with V3 of the IDF).
I’ll try re-installing esptool again tomorrow and report back.
Thanks…
-
mzimmers
- Posts: 643
- Joined: Wed Mar 07, 2018 11:54 pm
- Location: USA
Re: problem with esptool.py
Postby mzimmers » Wed Dec 04, 2019 2:53 pm
No luck.
When I start up the ESP-IDF Command Prompt, here’s what I get:
Code: Select all
Using Python in C:Usersmzimmers.CYBERDATAAppDataLocalProgramsPythonPython37
Python 3.7.3
Using Git in C:Program FilesGitbin
git version 2.21.0.windows.1
Setting IDF_PATH: C:esp-idf
Adding ESP-IDF tools to PATH...
C:esp32_toolchaintoolsxtensa-esp32-elfesp32-2019r1-8.2.0xtensa-esp32-elfbin
C:esp32_toolchaintoolsesp32ulp-elf2.28.51.20170517esp32ulp-elf-binutilsbin
C:esp32_toolchaintoolscmake3.13.4bin
C:esp32_toolchaintoolsopenocd-esp32v0.10.0-esp32-20190313openocd-esp32bin
C:esp32_toolchaintoolsmconfv4.6.0.0-idf-20190628
C:esp32_toolchaintoolsninja1.9.0
C:esp32_toolchaintoolsidf-exe1.0.1
C:esp32_toolchaintoolsccache3.7
C:esp32_toolchainpython_envidf4.0_py3.7_envScripts
C:esp-idftools
Checking if Python packages are up to date...
Python requirements from C:esp-idfrequirements.txt are satisfied.
Done! You can now compile ESP-IDF projects.
Go to the project directory and run:
idf.py build
C:esp-idf>
And when I try to run esptool.py, here’s the (start of) output:
Code: Select all
C:esp32_projectswifibuttonmfg>esptool.py write_flash 0x9000 nvs_reuse.bin
esptool.py v2.8
usage: esptool [-h] [--chip {auto,esp8266,esp32}] [--port PORT] [--baud BAUD]
[--before {default_reset,no_reset,no_reset_no_sync}]
[--after {hard_reset,soft_reset,no_reset}] [--no-stub]
The output is the same whether I execute the command with no parameters, or with nonsense parameters.
-
plusorc
- Posts: 34
- Joined: Sat Nov 09, 2019 6:27 am
Re: problem with esptool.py
Postby plusorc » Wed Dec 04, 2019 3:24 pm
@mzimmers
Can you test this ?
Put the full address of the Bin file you’re flashing .. not the IDF environment
I recently has a similar issue and it was esptool needing the full path of the Bin file
@ESP_Angus
With all due respect , I found the IDF Command in windows is very inconvenient
I wish there is a way to add those to the Path and be able to run idf.py from any directory .
I use vscode and can’t find a way to invoke idf.py from vscode , because I have to use the IDF command
If I copy the link of the shortcut , I get «This has to be run from ….»
a message telling that I have to be in the directory to use the idf.py
-
mzimmers
- Posts: 643
- Joined: Wed Mar 07, 2018 11:54 pm
- Location: USA
Re: problem with esptool.py
Postby mzimmers » Wed Dec 04, 2019 6:41 pm
Hi plusorc — thanks for the suggestion. I’m really more interested, however, in getting the command to work the way that Angus says it should. I probably messed up something with my install; I’m hoping that someone might have an idea exactly where to look.
-
mzimmers
- Posts: 643
- Joined: Wed Mar 07, 2018 11:54 pm
- Location: USA
Re: problem with esptool.py
Postby mzimmers » Tue Dec 10, 2019 7:57 pm
BTT. Any suggestions? Thanks…
-
ESP_Angus
- Posts: 2344
- Joined: Sun May 08, 2016 4:11 am
Re: problem with esptool.py
Postby ESP_Angus » Wed Dec 11, 2019 3:24 am
Hi mzimmers,
Sorry, I gave you some incorrect information — I thought that «pip install esptool» would install an esptool.py.exe on the PATH, but it’s actually «esptool.exe».
I ran through the install steps on a clean VM again. You should be able to run:
Code: Select all
esptool write_flash 0x9000 nvs_reuse.bin
In the ESP-IDF Tools Command Prompt window, and this should work.
(You could also choose to «pip install esptool» inside your global Python install to run esptool.exe from any command prompt window.)
BTW, even though ESP-IDF build system will print full paths to everything:
Code: Select all
C:Usersgus.espressifpython_envidf4.0_py2.7_envScriptspython.exe ......componentsesptool_pyesptoolesptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 buildbootloaderbootloader.bin 0x8000 buildpartition_tablepartition-table.bin 0x10000 buildhello-world.bin
You can strip off the first part and run this, if you’re in the ESP-IDF Command Prompt then python.exe is on the PATH:
Code: Select all
python.exe ......componentsesptool_pyesptoolesptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 buildbootloaderbootloader.bin 0x8000 buildpartition_tablepartition-table.bin 0x10000 buildhello-world.bin
OR
Code: Select all
python.exe %IDF_PATH%componentsesptool_pyesptoolesptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 buildbootloaderbootloader.bin 0x8000 buildpartition_tablepartition-table.bin 0x10000 buildhello-world.bin
(These last two work without the «pip install esptool» step required.)
-
mzimmers
- Posts: 643
- Joined: Wed Mar 07, 2018 11:54 pm
- Location: USA
Re: problem with esptool.py
Postby mzimmers » Wed Dec 11, 2019 3:35 pm
Hi, Angus — thanks, that did help. Now: can anything be done about making this command briefer?
Code: Select all
$ python C:esp-idfcomponentsnvs_flashnvs_partition_generatornvs_partition_gen.py generate nvs_reuse.csv nvs_reuse.bin <size>
-
ESP_Angus
- Posts: 2344
- Joined: Sun May 08, 2016 4:11 am
Re: problem with esptool.py
Postby ESP_Angus » Wed Dec 11, 2019 11:49 pm
mzimmers wrote: ↑
Wed Dec 11, 2019 3:35 pm
Hi, Angus — thanks, that did help. Now: can anything be done about making this command briefer?Code: Select all
$ python C:esp-idfcomponentsnvs_flashnvs_partition_generatornvs_partition_gen.py generate nvs_reuse.csv nvs_reuse.bin <size>
Maybe, but it’s not straghtforward on Windows. On other OSes it’s pretty simple to add C:esp-idfcomponentsnvs_flashnvs_partition_generator to your PATH and then you can run nvs_partition_gen.py as a script…
On Windows this depends on what associations are crerated for .py files to launch with on Windows. If you can set them to launch with a Python interpreter that has all of the libraries required (either the python.exe inside the IDF virtualenv, or your global Python if you’ve installed anything that’s needed there) then this will work. But it’s outside the scope of ESP-IDF, sorry.
I’d suggest adding a custom target to your project CMakeLists file to run the generator automatically on each build, instead.
Who is online
Users browsing this forum: No registered users and 43 guests
Pages 1
You must login or register to post a reply
1 04-05-2022 00:57:26 (edited by 74LS00 04-05-2022 00:57:34)
- 74LS00
- Member
- Offline
Topic: Конфликт Python
Win7 пытаюсь поставить esptool, в системе стоял Python 3.8 (64-bit) уже не вспомнить для чего, но после svp обновлялся
команда pip install esptool выдаёт ошибку
ImportError: Module use of python39.dll conflicts with this version of Python.
Пытаюсь чтото нагуглить и предлагают снести svp
https://www.reddit.com/r/KoboldAI/comme … conflicts/
Захожу в свойства системы и вижу PYTHONPATH C:Program Files (x86)SVP 4mpv64
так и есть питона украли.
Теперь вообще непонятно что делать.
Или накатывать питона по новой и пофиг что с svp будут, или вообще всё сносить и переставлять пока не заработает хоть чтото.
Но помню прошлый раз с бубном питона ставил долго, тоже никак не хотел работать pip
2 Reply by Chainik 04-05-2022 05:39:19
- Chainik
- SVP developer
- Offline
- Thanks: 1455
Re: Конфликт Python
PATH и PYTHONPATH указывающие на SVP нужны только для VLC / Plex / Vapoursynth Filter.
И то если VLC запускать через меню SVP, то не надо.
3 Reply by 74LS00 04-05-2022 12:22:08 (edited by 74LS00 04-05-2022 12:23:16)
- 74LS00
- Member
- Offline
Re: Конфликт Python
Изменения PYTHONPATH на папку в профиле ничего не дали.
Получилось примерно так.
Снести нафик питона.
Закрыть SVP плеер иначе питон похоже лезет не туда.
Запустить установщик python-3.8.6-amd64.exe вроде как последний для w7.
внизу выбрать птичку path
и выбрать режим установки custom, ну и просто далее.
Вот только тогда появился pip.
Вот потом команда установки pip install esptool
И работать это будет через команду esptool
esptool.py в винде не работает, но во всех гайдах только он.
Всётаки питон это удлинённая версия вантуза
4 Reply by Chainik 04-05-2022 12:58:43
- Chainik
- SVP developer
- Offline
- Thanks: 1455
Re: Конфликт Python
> внизу выбрать птичку path
ну так он те же два пути и устанавливает, никакой магии
5 Reply by 74LS00 04-05-2022 16:41:24
- 74LS00
- Member
- Offline
Re: Конфликт Python
У меня работал mpc-hc через svp с музоном и так pip оживить не удалось пока плеер не закрыл. Хотя возможно закрыл и браузер и он выедал память. Сам svp в трее не трогал.
До этого ставил pip со скрипта, но не помогало.
Суть в том path мало на что влияет и без перезагрузки врятли поможет, а я её так и не сделал. Пробовал запускать питона через батник, ну не видит он этот файл .py который гдето лежит в библиотеках питона в профиле, и указания пути не помогают.
У меня с питоном много лет такая шляпа, всегда чтото не работает, надеюсь svp теперь не поломался и esp работать сможет.
Сейчас стоит mpc-hc 64 бит (куда пропала 32 бит не знаю). Много не слушал, но вообще проблема svp была с повисание плеера после 10-15 клипов, не знаю решилась ли, но врятли.
Posts: 5
Pages 1
You must login or register to post a reply
This article on how to install Esptool on Windows 10 was written because I remembered that I had been for a time wondering how to do it. If you’re a Windows user, you’re probably used to graphical interfaces. You’re also used to easy installs – download an installer file, run or open the file, follow the installation instructions, and it’s done.
Installing Esptool is a two-part process. First you download and install Python. Then, you run a Python command to install Esptool.
Esptool runs on the scripting and programming language Python. Therefore, we need to install Python first before we install Esptool.
How to Install Python
On Windows 10, you may simply type “python” on the Windows search box beside the Windows Start button and download Python from the Windows App Store. An issue with this procedure is that you may get an older version of Esptool from the App Store.

If you want to get the latest version of Python, downloading the installer from the Esptool download page is the way to go.

Run the downloaded Esptool installation file. As of this writing, the installation file for the latest version is python-3.8.1.
You may want to put a check mark on the Add Python 3.8 to PATH before clicking on the Install Now button. This will make it easier to start the Python and the Esptool program. Without the check mark, before you can run Python or Esptool, you would need to find the directory where you installed Python. You then would have to change your current directory to the Python’s folder.

After successfully installing Python, open a command prompt window.
Type cmd on the Windows search box and click on the Command Prompt app. Then type the command pip install esptool.

A successful Esptool installation will look like the screenshot below.

Testing the Esptool Installation
A quick test of the Esptool installation can be done by issuing the command esptool.py version.

Congratulations! You now have Esptool installed and ready for use on your ESP8266 or ESP32 development board.
Examples of Possible Uses
|
esptool.py read_flash 0 0x400000 firmware_backup.bin |
Related Articles on How to Install Esptool on Windows 10
How to Install Arduino IDE on Windows 10
How to Set up Arduino IDE for ESP8266 Programming
How to Test NodeMCU V3 Using Esptool
NodeMCU V3 ESP8266 Pinout and Configuration
NodeMCU ESP-32S Pin Configuration
References on How to Install Esptool on Windows 10
Esptool Wiki on Github
Python on Wikipedia
Python Website
-
andymouse
- Posts: 12
- Joined: Sat Apr 06, 2019 7:05 pm
Installation of esptool
Hi
Unfortunately I have fallen at the first hurdle !
I am using a windows 10 machine, and have installed Python 2.7 and am greeted with a window detailing version number,
at the prompt I type «pip install esptool» and I receive «File «<STdin>»,line1 syntax error: invalid syntax
I have watched a few tutorials and tried different versions of python and different lines including «pip2» and «sudo» but cannot see what I am doing wrong. Python seems to be ok as no errors if I type something like «2*8» I get 16, I must be missing something silly but dont no what.
Please help.
Andy
-
cefn
- Posts: 230
- Joined: Tue Aug 09, 2016 10:58 am
Re: Installation of esptool
Post
by cefn » Sun Apr 07, 2019 7:13 am
Well done for getting this far from a standing start! The problem you’re facing is you are running a pip command INSIDE the python shell. ‘pip’ is a command, like ‘python’ which you should type directly into the Windows terminal. If you are in the python shell, press CTRL+C then type the python instruction exit() and press enter to leave the shell before running a pip command. If you need to launch a Windows terminal from scratch go to start, run and type CMD.exe. Your pip command should work there.
-
andymouse
- Posts: 12
- Joined: Sat Apr 06, 2019 7:05 pm
Re: Installation of esptool
Post
by andymouse » Sun Apr 07, 2019 7:10 pm
Hi
I am so close I can taste it !!
I have finally after a few hours, and a lot of learning, got to the point where I have «erased» my lolin d1 mini and copied a «.bin» file to it both procedures completed with no errors. I have a better understanding of «esptool» now. I had to change the port from,» port /dev/ttyUSB0″ to com8 and I set the baud rate to 115200 and watched as the files where copied. I now open «PuTTY» and select com8 and yeah! the Repl appears, but (sad bit) when I type print «hello world» I get:-
>>> Print «hello world»
Traceback (most recent call last):
File «<stdin>», line 1
Syntax Error: invalid syntax
>>>
however if I type print («hello world») I get :-
>>>
>>> print («hello world»)
hello world
>>>
also if I type 2*8 I get
>>> 2*8
16
>>>
also typing help() gives me the correct page. As I said so close, and all I want to do is learn Micropython!…I will show you what happens if I hit reset on my esp8266, actualy its just «hung up» will now have to restart PuTTY. also if I do a «soft reboot» I get;-
PYB: soft reboot
OSError: [Errno 2] ENOENT
MicroPython v1.10-8-g8b7039d7d on 2019-01-26; ESP module with ESP8266
Type «help()» for more information.
>>>
Here’s another error message:-
>>>
>>> import machine
>>> from machine import pin
Traceback (most recent call last):
File «<stdin>», line 1, in <module>
ImportError: cannot import name pin
>>>
Have you any thoughts or can you point me on to the next step, sorry if the format is wrong and I am not much use from the «command line» but trying my best
Andy
-
Roberthh
- Posts: 3663
- Joined: Sat May 09, 2015 4:13 pm
- Location: Rhineland, Europe
Re: Installation of esptool
Post
by Roberthh » Sun Apr 07, 2019 7:40 pm
Congratulations, you arrived. Now you have to learn the specifics of this Python variant.
First of all, it is more or less python 3.4. with some python 3.5 extensions. So you have to write:
print(«Hello World»)
Second: The error message:
Code: Select all
OSError: [Errno 2] ENOENT
MicroPython v1.10-8-g8b7039d7d on 2019-01-26; ESP module with ESP8266
When booting, Micropython tries to execute boot.py and main.py in that order. On an fresh installed device, main.py does nto exist, and that causes the error message.
To get rid of the error message, you can create main.py skeleton with:
Code: Select all
f = open("main.py", "w")
f.write("# Put your code heren")
f.close()
Third: Python is case sensitive, and the module you look for is called Pin. So use.;
from machine import Pin
-
andymouse
- Posts: 12
- Joined: Sat Apr 06, 2019 7:05 pm
Re: Installation of esptool
Post
by andymouse » Sun Apr 07, 2019 10:31 pm
Hi
Thanks !! that cleared that up and all does indeed appear to be fine, now I’m gonna have to hit the books! I now need to get into a Python mind set. I have one last request, I’ve just had a quick play and attempted to switch an Led on and off and I thought I had it correct but nothing on my Lolin/Wemos D1 Mini changed state and also Repl didn’t moan at me so I dont even no if my board is ok or my thinking is wrong, are you familiar with this board? would you show me how to toggle an LED ? does it need to be inside «main.py»? Once again thank you, your a star!
Andy
-
ThomasChr
- Posts: 121
- Joined: Sat Nov 25, 2017 7:50 am
Re: Installation of esptool
Post
by ThomasChr » Mon Apr 08, 2019 5:01 am
You can toggle a led on the REPL.
Use a while loop with time.sleep() for maybe half a second or so. I haven‘t got the specific code in mind but if you really fail just say so and I look it up and test it for you!
Thomas
Last edited by ThomasChr on Wed Apr 10, 2019 1:42 pm, edited 1 time in total.
-
andymouse
- Posts: 12
- Joined: Sat Apr 06, 2019 7:05 pm
Re: Installation of esptool
Post
by andymouse » Mon Apr 08, 2019 9:16 am
thanks, but all is well just getting used to It, the problem I had was a dodgy breadboard so my journey has begun thanks to all!
Andy
-
Jadno
- Posts: 5
- Joined: Mon Apr 08, 2019 2:05 pm
Re: Installation of esptool
Post
by Jadno » Wed Apr 10, 2019 12:35 pm
Hello! Is your question resolved? You do not explain to me why pip did not work? I would love to discuss this because I have the same problem. I tried to сompare and synchronize SQL Server database schemas yesterday and I got a bug. Still, this now to solve(
Last edited by Jadno on Thu Apr 11, 2019 2:23 pm, edited 1 time in total.
-
andymouse
- Posts: 12
- Joined: Sat Apr 06, 2019 7:05 pm
Re: Installation of esptool
Post
by andymouse » Wed Apr 10, 2019 1:59 pm
Hi
«pip» did not work because I used a version of Python that did not contain the correct files. I then installed the latest Python and my troubles went away. If you install the latest Python follow the instructions carefully because you will be asked to check (Tick) a box that sets the proper «path» for the install, you MUST check this box! After that I found the «pip» command worked as described in the various tutorials. The other error messages that I had were fixed by following the instructions above this post which basically put something in the Micropython file «Main.py»
Hope this helps and you can move on
Andy
-
Jadno
- Posts: 5
- Joined: Mon Apr 08, 2019 2:05 pm
Re: Installation of esptool
Post
by Jadno » Thu Apr 11, 2019 2:23 pm
Thank you very much! I understood it would help! This was the case for me. I also had VMDK problems. I knew that some common reasons which can cause corruption in the Virtual machine disk file – Virus Infection, Dirty shutdown or abruptly system shutdown and one of the main reasons of this error is included human mistakes such as accidental deletion or removal of the important files, cleaning the system registry, improper disk management issues or forcefully termination etc.
I followed the steps to repair VMDK file data manually and it didn’t help but the restoration program did help, everything is fine now.
@Nolrox
Python-разработчик
Качаю Python, захожу в консоль, пишу pip install и выдает что «pip» не является внутренней или внешней командой, исполняемой программой или пакетным файлом. Что делать?
-
Вопрос заданболее двух лет назад
-
40597 просмотров
Добавить в PATH.
Гугли переменные среды
Или даже будет быстрее переустановить питон и при установке поставить соответствующую галочку.
Если винда, то тут 99% что при установке не поставил галочку добавить пути в PATH.
1. Руками прописать
2. Удалить и поставить заново, не пропустив галочку
Скорее всего, у вас просто не была установлена галочка на работу пипа со всех директорий, или переустановите пайтон, почтавив эту галочку, илм пробуйте выполнять эту команду с директории где находится пайтон
Пригласить эксперта
Нужно обновить pip:
python -m pip install --upgrade pip
Скорее всего вы используете Python 3.9. Но многие мейнтейнеры не успели обновить пакеты. Поэтому установите Python 3.8
Discord.py поддерживается пока питоном 3.5 … 3.8!
И неплохо бы установить Microsoft C++ Build Tools, пригодится для установки некоторых пакетов.
если галочка PATH python не сработала можно: настроить ручную.
здесь объясняют как в ручную настроить PATH для python (для pip достаточно просто указать в PATH адрес к scripts в каталоге python)
-
Показать ещё
Загружается…
29 янв. 2023, в 03:07
300000 руб./за проект
29 янв. 2023, в 02:16
700000 руб./за проект
29 янв. 2023, в 01:54
5000 руб./за проект