Page 3 of 4

Re: [SOLVED]Issues running on ESP8266MOD(NODEMCU board)

Posted: Fri Dec 06, 2019 10:59 pm
by dps
So while the source of a particular venv is activated, i can move around the system and still use the commands, because when i activated that venv it added the /bin to my path (in addition to other variables). After deactivating the venv, my $PATH will return to normal, and all things that i changed (in regards to python and pip) stay in that venv, for later use?

Ah, and thank you for the heads up on the erase_flash. I will keep that in mind. now that i have this all setup correctly, its time to move on from just accessing a repl and blinking and led that attached to a pin that i defined. :)

Re: [SOLVED]Issues running on ESP8266MOD(NODEMCU board)

Posted: Fri Dec 06, 2019 11:05 pm
by MostlyHarmless
dps wrote:
Fri Dec 06, 2019 10:59 pm
So while the source of a particular venv is activated, i can move around the system and still use the commands, because when i activated that venv it added the /bin to my path (in addition to other variables). After deactivating the venv, my $PATH will return to normal, and all things that i changed (in regards to python and pip) stay in that venv, for later use?
Yes. The venv is just a directory structure hanging off you $HOME. Whatever you do with pip while that venv is active will be persistent. If you need to start over or "think" you never need it again, "rm -rf obsolete-venv" will do the job. The "think" part is what bit me a couple times in the beginning, as I am not very good at measuring twice before cutting once, if you get the drift.


Regards, Jan

Re: [SOLVED]Issues running on ESP8266MOD(NODEMCU board)

Posted: Fri Dec 06, 2019 11:10 pm
by dps
haha right on! I have to thank you man, for helping me like this. For some reason I cant understand a lot of what people tell me, or i guess i dont catch on to what they mean when they tell me things or how to do things, but when I was able to understand you though. Thanks again!
One thing i did just notice though, upon reactivating the venv i used to erase the flash and reflash the prior device, the esptool.py wasnt there any more. I had to reinstall it using pip. is this normal? I did change the directory name after i deactivated it, idk if that would have done anything though.

Re: [SOLVED]Issues running on ESP8266MOD(NODEMCU board)

Posted: Fri Dec 06, 2019 11:37 pm
by dps
hmm, now i seem to be more confused lol. After deactivating (via deactivate) the venv, the esptool.py i am still able to use the esptool.py command, that only had installed via pip, while the venv was activated.

Re: [SOLVED]Issues running on ESP8266MOD(NODEMCU board)

Posted: Sat Dec 07, 2019 12:52 am
by MostlyHarmless
One too many levels of redirections, I guess. A simple "which esptool.py" sometimes clears things up.

Normally that "which" command should point somehow into $HOME/<active-venv>/...

If it doesn't, then you probably didn't install that tool in <active-venv>.

Re: [SOLVED]Issues running on ESP8266MOD(NODEMCU board)

Posted: Sat Dec 07, 2019 1:11 am
by dps
Heres what im doing:
python3 -m venv /path/to/venvdir/specificvenv
then I run `source /path/to/venvdir/specificvenv/bin/activate`.

then i run `pip install esptool`. should i be doing this while in a specific directory, or should this be getting installed into the virtualenv only (while its activated) no matter where im at, as long as the env is activated?

maybe thats what going on. Im not actually in the venv directory when i run the install command. ill try it the other way now

Re: [SOLVED]Issues running on ESP8266MOD(NODEMCU board)

Posted: Sat Dec 07, 2019 1:15 am
by dps
hmm, you know. maybe im doing this all wrong. should i even be using `pip install esptool` in order for the package i install to be only in the venv, or should i be using some other command? maybe i should be using pip3, since i created the venv with python3.

Re: [SOLVED]Issues running on ESP8266MOD(NODEMCU board)

Posted: Sat Dec 07, 2019 1:27 am
by dps
i think that i may have figured it out. I made sure I was in the actual directory of the venv this time, but i think that using pip3 this time is what made it work as expected. Again, thank you for your help. I think i should stop talking on this thread as its gotten a tad bit off topic from the original post.
Hope to see you sometime, somewhere, soon!

Re: [SOLVED]Issues running on ESP8266MOD(NODEMCU board)

Posted: Sat Dec 07, 2019 1:39 am
by MostlyHarmless
Getting off topic is natural for this sort of topic. Pun intended.

Sometimes reading pip's output carefully and following up with an "install --upgrade <pkg>" is a good idea.

Re: [SOLVED]Issues running on ESP8266MOD(NODEMCU board)

Posted: Sat Dec 07, 2019 1:48 am
by dps
haha right.

so i just tried to test my theories from before, and it seems that i was wrong about using pip or pip3 having the effect that would install that package system wide. I tried them both, but while i was in the top level of the new venv, and either way, after deactivating, i didnt find it on my system anywhere, and it was still in the venv when i activated it again (via source /dir/venv/) and ran the `which esptool.py` command.

I may be wrong here, it seems that if i want packages to be installed (that i install with pip or pip3) ONLY in the venv, and not across my system, i need to be in the actual directory of the venv? is this correct, or am i getting this wrong?