Downloaded module not found in IDLE - machine-learning

I am trying to use some libraries I downloaded, but whenever I check for them in IDLE I don't see them.
The same thing happens when I type from sklearn import datasets
But when I try to pip install I see this:
Does this mean I am limited to only the Spyder IDE?

There are somehow distinct distributions of Python that you seem to be running. I would suggest using virtualenv and running your IDE (idle/others) via that. Here's a tutorial video for it. [1]
[1] https://teamtreehouse.com/library/idle-in-a-virtual-environment-2

Related

pydrake is not available for installation anymore through google colab?

I have been using a google colab template for iterative LQR that uses the Pydrake, however, it seems like the code repository is removed and I can't reinstall it on google Colab:
try:
import pydrake
import underactuated
except ImportError:
!curl -s https://raw.githubusercontent.com/RussTedrake/underactuated/master/scripts/setup/jupyter_setup.py > jupyter_setup.py
from jupyter_setup import setup_underactuated
setup_underactuated()
# Setup matplotlib backend (to notebook, if possible, or inline).
from underactuated.jupyter import setup_matplotlib_backend
plt_is_interactive = setup_matplotlib_backend()
File "/content/jupyter_setup.py", line 1
404: Not Found
^
SyntaxError: invalid syntax
I tried clicking this link https://raw.githubusercontent.com/RussTedrake/underactuated/master/scripts/setup/jupyter_setup.py, and the page is not found... everything was working fine yesterday
Sorry. You're correct... I updated it this morning, and don't have a good deprecation policy in place on that repo, and this setup script is two versions ago. The path you want is https://raw.githubusercontent.com/RussTedrake/underactuated/master/setup/jupyter_setup.py
(remove the script from the directory). But if you look at that file, you'll see that even that is pointing to an updated setup script which you might want to point to.
This is actually all good news... we are on the path to a much better solution. You can now just pip install drake on colab (see the drake installation guide). Once I land the pip install underactuated (probably in time for my Spring offering of the class), then all of that nasty setup will be gone.

Openpyxl in Spyder

I am using openpyxl in spyder IDE to create a new excel workbook. The program runs with no error, however no excel workbook was created.
I copied the code into sublime text, and ran the code in command prompt and it worked perfectly good, with the new excel created
Can someone please explain what i am doing wrong in spyder and how to fix it?
I got stuck with the same problem. To resolve it I verified the Python interpreter's version used by my Spyder (there were some of them on my computer). I found out that it wasn't using the one I needed it to. So I changed it to the appropriate version's one with the followed installation of the lacking Spyder kernels with python -m pip install spyder-kernels and all the specific modules I needed to complete my tasks.
Hope the advise to be useful. Have a nice day.

Cant upload to the NodeMCU Lua

I have a NodeMCU board running the Lua interpreter, I can access the serial connection via the nodemcu-tool to input commands but when using the nodemcu-tool to upload or reset the filesystem it returns
[NodeMCU-Tool]~ Unable to establish connection
[NodeMCU-Tool]~ Timeout, no response detected - is NodeMCU online and the Lua interpreter ready ?
I might have an answer:
I ran into the same (or very, very similar) problem, on Mac OS X Mojave.
In the end, I reverted to completely uninstalling Node.js (this experience does not help convincing me of Node.js but that is another story) and start from scratch.
Even that did not help because I ran into trouble installing nodemcu-tool ...
Previously I installed it as a global package, and that somehow worked, but it caused me to always sudo my nodemcu-tool invocations - not a good thing!
In any case, sudo-ing plus the commandline parameter "--connection_delay" (or as a project setting, "connectionDelay") helped getting me going.
Until I messed up, and reinstalled everything from scratch. However, the key difference to the instructions for installing nodemcu-tool was adding the '--unsafe-perm' parameter to it, like so:
sudo npm install --unsafe-perm nodemcu-tool -g
That was to be able to get past the repeated installation errors for the serialport package...
IMO, relying on unsafe permissions (for what exactly, anyway!?) is, well, UNSAFE! GRRRRR
To the OP, make sure that:
you have installed Node.js and nodemcu-tool properly (download stable installer etc), and
that you use the --connection_delay parameter in each and every nodemcu-tool invocation!
I had the same problem!
The solution was to reset the board:
Conect the board via USB and press FLASH + RST (two buttons on the board)
relese FLASH
relese RST
Now you can upload your sketch.
If it doesn't work try to disconnect all pins. In my case the GPIO4 was soldered to a LED-Strip and i it was imposible to load the sketch until i disconnected it.

Spyder 3.1.2 hangs at Python Console

When ask Spyder to run my program from the Python Console it gives me different responses. Sometimes, it doesn't run the program, other times it hangs. When it hangs I have to manual break the program with Ctrl+enter.
Have I loaded Spyder incorrectly? Do I need to configure my interface differently? Any suggestions?
(Spyder developer here) Because of this and several other bugs, the Python console is going to be removed in Spyder 3.2.
Please use the IPython console instead.

how to combine Opencv module (virtualenvwrapper) and Tensorflow module (another virtualenv)?

Following several instructions on the web, I could install Opencv3.0 and tensorflow on my Ubuntu 16.04. Each tutorial recommends using virtual environment. Although I agree that, problem is that I just followed the tutorials and created separate environments.
** For minor information, Tensorflow installation was easy, but Opencv3.0 was hard.
I used virtualenv for Tensorflow with the name tf, and virtualenvwrapper for Opencv with the name cv, i.e., I activate tf by $ source ~/project/tf/bin/activate, and cv by $ workon cv.
In this case, what is the best way of using both?
Should I activate both always?
Should I enter one environment and install the other again?
Should I symlink site-package/cv.so to tf environment?
I think cv is now in the python site-package folder. I create tf with --site-package option, but it was before installing cv. I am so confusing. Please help.
Yes, I had the same issue and the sym-link between tensorflow and openCV will not work after making the cv.so inside the tf virtualenv after some struggle I got them both to work in the same environment but I suggest uninstalling openCV and then install it back without using a virtual environment for better results.
Cheers.

Resources