Spyder complains "torch" module is not found - spyder

I am trying to run a file with 'torch' module in it. However, when I arrive at a line that contains:
training_set = torch.FloatTensor(training_set)
test_set = torch.FloatTensor(test_set)
it pops out the error that 'torch' is 'ModuleNotFoundError'
The below screenshots shows the pop-up error and I also checked whether 'torch' is up to date.
I am using Spyder

This is an open issue in Spyder: https://github.com/spyder-ide/spyder/issues/16348
For the moment, as a workaround, you can enable the option Exclude unsupported data types from the Variable Explorer options menu

Related

Why Zerobranestudio Configuration error occurs?

Error while loading configuration file: 'cannot open C:\Users\안진형\Desktop\ZeroBraneStudio.zbstudio\user.lua: Invalid argument'.
Error while loading configuration file: cannot open C:\Users\안진형\Desktop\ZEROBR~1\cfg\tomorrow.lua: Invalid argument
What is "ZEROBR~1" in directory? and Why this message occurs?
I'm setting this program for code debugging and changeing color scheme of zerobranestudio, but I don't know how to open code file and how to change color scheme.
I've tried to do this and succeed to open tommorow.lua. Then Why this error message occurs?
How can i change color scheme?
http://bitstopixels.blogspot.com/2016/09/changing-color-theme-in-zerobrane-studio.html
I've tried this manual and succeed to open scheme-picker.lua. In that link's statement, If i choose color like "Tommorownightblue", Zerobranestudio's color changed to that color. But when i clicked "TommorownightBlue", Error while loading configuration file: cannot open C:\Users\안진형\Desktop\ZEROBR~1\cfg\tomorrow.lua: Invalid argument message occurs.
I'm not absolutely sure, but I'd try loading the configuration files from a different location. Can you move ZeroBrane Studio installation to a location that doesn't have your username in it, as I suspect it may be some encoding issue, which doesn't allow the file name to be properly passed to the open function.

How to start spyder

spyder will not work after installing Anaconda3-5.3.1-Windows-x86_64.exe on extra drive.
The error is: E:\Anaconda3\lib\site-packages\zmq\backend\cython_init_.py", line 6, in
from . import (constants, error, message, context,
I have discovered how to solve this problem myself. The PATH needs to be edited to add an additional path. The complete method is described in detail in:
www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/
In my case I added E:\Anaconda3\Library\bin. Spyder now loads from the E drive.

error FS0039: The field, constructor or member 'X' is not defined

I am trying to run my code interactively in an fsx file. I have loaded all the dlls required, I then try to load the required files with #load but when I load the "Utlities.fs" file which depends on a function in the top file "HttpGetExchangeRate.fs" i get the error "Utilities.fs(88,42): error FS0039: The field, constructor or member 'getExchangeRates' is not defined"
Dose the 'getExchangeRates' not get defined when i load "HttpGetExchangeRate.fs"as in the image below or an I missing something?
#load "HttpGetExchangeRate.fs"
#load "Utilities.fs"
open System
open FsCheck
open NUnit.Framework
open HttpClient
InvoiceApp.Http.getExchangeRates "EUR" "USD"
InvoiceApp.Math.convertInvoicingCurrencyToEuro 200.00M "EUR"
Here is an image of the error message
If I understand your scenario correctly, this is due to a bug in how namespaces are handled in FSI. The workaround is to open the namespace you need before #loading the second file
#load "HttpGetExchangeRate.fs"
open InvoiceApp
#load "Utilities.fs"
That should get you unblocked for now, the bug has since been fixed (F# 4.0/VS 2015 will have the fix).
It sounds like you are running into the issue described in this question with implicit modules in fsi.
How to load external F# code and use it in fsi

F# Interactive CsvProvider not defined

I'm loading FSharp.Data in the interactive console. The library is loaded without any problem:
> #r "FSharp.Data.dll";;
--> Referenced 'C:\Users\pw\AppData\Local\Temp\FSharp.Data.dll' (file may be locked by F# Interactive process)
> open FSharp.Data;;
However, when I'm trying to initialize CsvProvider (defined in FSharp.Data) I get the error message saying the type is not defined:
> type Stocks = CsvProvider<"C:\Users\pw\Downloads\msft.csv">;;
type Stocks = CsvProvider<"C:\Users\pw\Downloads\msft.csv">;;
--------------^^^^^^^^^^^
stdin(62,15): error FS0039: The type 'CsvProvider' is not defined
I thought the problem may be with file and assemblies paths but now I'm using absolute paths and the error remains. On the other hand, I am able to use the CsvProvider when I'm creating a standard, not interactive, project. Any help to make it work in interactive session highly appreciated.
The warning about file being locked looks worrisome. Can you copy FSharp.Data somewhere and reference it using absolute path:
\#r #"C:\Poligon\packages\FSharp.Data.2.1.0\lib\net40\FSharp.Data.dll";;
Downgrade your FSharp.Core to 4.7 and FSharp.Data to 3.3.3. It should work after that.

lua lxp The specified module could not be found

I'm putting together an application that uses the moon soap, but when you run it reports the following error :
C:\Lua\5.1\lua.exe: error loading module 'lxp' from file 'C:\Lua\5.1\clibs\lxp.dll':
The specified module could not be found.
How do I fix this ?
This is not a "file not found" error. Note that the message stated that it tried to load the module "lxp" from a file ('C:\Lua\5.1\clibs\lxp.dll') but it didn't work. Maybe the file doesn't have a luaopen_lxp C function (which might be called by loadlib)... Or maybe you are not loading it with require...

Resources