File does not exist error when I run hello.go program - windows

I am following go documentation and try to run hello.go.
I am on Windows 7 and install go 1.1.2 using msi installer.
I have file "C:\Go\pkg\tool\windows_386\8g.exe" (see dir output below), but when I do 'go.exe run hello.go', I get the file does not exist error.
Please help. Thank you.
C:\>go.exe run hello.go
go build command-line-arguments: exec: "C:\\Go\\pkg\\tool\\windows_386\\8g.exe":
file does not exist
C:\>go.exe version
go version go1.1.2 windows/386
C:\>go.exe run hello.go
go build command-line-arguments: exec: "C:\\Go\\pkg\\tool\\windows_386\\8g.exe":
file does not exist
C:\>dir C:\\Go\\pkg\\tool\\windows_386\\8g.exe
The specified path is invalid.
C:\>dir C:\Go\pkg\tool\\windows_386\\8g.exe
Volume in drive C is Local Disk
Volume Serial Number is C07E-54F5
Directory of C:\Go\pkg\tool\windows_386
08/13/2013 07:04 AM 1,831,416 8g.exe
1 File(s) 1,831,416 bytes
0 Dir(s) 11,407,892,480 bytes free

From issue 6224, this error happens if you had the environment variable PATHEXT set to only one extension, before running go.exe.
set PATHEXT=.BAT
go run hello.go
What is the expected output?
no errors and hello world program runs
What do you see instead?
go build command-line-arguments:
exec: "c:\\Go\\pkg\\tool\\windows_386\\8g.exe": file does not exist
8g
Windows 7 64bit
go version go1.1.2 windows/386
On my computer (W7 64 bits), I have:
set pa
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
and everything runs just fine.
LookPath is called with "c:\Go\pkg\tool\windows_386\8g.exe" and the fact that PATHEXT is being set in an evil way let's say, make LookPath fails

For windows users :
If using vscode type this on terminal
$env:GOOS="windows"
else type this in windows powershell

Related

How to get Kotlinc 1.8.0 to run with Ubuntu on Windows

I installed Kotlinc through the zip file kotlin-compiler-1.8.0.zip and extracted it and moved the kotlinc\bin files to my C:\Program files. I later then verified that I had installed it correctly by running the kotlinc -version command in the terminal and got back info: kotlinc-jvm 1.5.21 (JRE 16.0.2+7-67). So I believe I have that working just fine. So I believe now the error is arising from Java somehow.
When I go to run my simple hello world program with this:
kotlinc main.kt -include-runtime -d main.jar
I am met with the error:
/mnt/c/Program Files/kotlinc/bin/kotlinc: line 98: java: command not found
Previously I was just getting: kotlinc command not found. I later read on StackOverflow someone else was having the same problem and the answer to that solution was just add it to the environment Variable path, in which I did but I very soon then ran into this issue.
I have since tried everything I have came across on this issue, I've reinstalled the kotlinc compiler and java and put the Java\jdk16.0.2\bin in my environment variable path as well. When I try to run the simple command kotlinc help in Ubuntu I am also met with the same line 98: java command not found error.

Unable to Install Go-Ipfs from source

I'm trying to Build IPFS from Source on windows 10.
Previously i installed it from source.It was working fine. But i needed the latest source so i started again from the scratch. because i edited some parts in the source.
I followed instructions on https://github.com/ipfs/go-ipfs/blob/master/docs/windows.md.
I received following error on executing following commands.
code
cd %GOPATH%\src\github.com\ipfs\go-ipfs
make install
Error
go version go1.12.6 windows/amd64
bin/check_go_version 1.12
go install -asmflags=all=-trimpath="D:\GO_WORKSPACE" -gcflags=all=-trimpath="D:\GO_WORKSPACE" -ldflags="-X "github.com/ipfs/go-ipfs".CurrentCommit=810cb607e-dirty" ./cmd/ipfs
# github.com/ipfs/go-ipfs/plugin/loader
plugin\loader\preload.go:11:2: undefined: pluginipldgit
plugin\loader\preload.go:12:2: undefined: pluginbadgerds
plugin\loader\preload.go:13:2: undefined: pluginflatfs
plugin\loader\preload.go:14:2: undefined: pluginlevelds
make: *** [cmd/ipfs/Rules.mk:37: cmd/ipfs-install] Error 2
I tried Adding this plugins in to preload.go file under src\github.com\ipfs\go-ipfs\plugin\loader directory.
exisiting code on preload.go.
import (
"github.com/ipfs/go-ipfs/plugin"
)
i added after the issue
import (
"github.com/ipfs/go-ipfs/plugin"
pluginipldgit "github.com/ipfs/go-ipfs/plugin/plugins/git"
pluginbadgerds "github.com/ipfs/go-ipfs/plugin/plugins/git"
pluginflatfs "github.com/ipfs/go-ipfs/plugin/plugins/git"
pluginlevelds "github.com/ipfs/go-ipfs/plugin/plugins/git"
)
so after i added this lines result is success.
Executed command
make install
Result
go version go1.12.6 windows/amd64
bin/check_go_version 1.12
go install -asmflags=all=-trimpath="D:\GO_WORKSPACE" -gcflags=all=-trimpath="D:\GO_WORKSPACE" -ldflags="-X "github.com/ipfs/go-ipfs".CurrentCommit=810cb607e-dirty" ./cmd/ipfs
Then i tried to start the ipfs using following command
ipfs daemon
Error
Initializing daemon...
go-ipfs version: 0.4.22-dev-810cb607e-dirty
Repo version: 7
System version: amd64/windows
Golang version: go1.12.6
Error: unknown datastore type: flatfs
Can someone help me configure the IPFS from source.
Thanks in advance.
I solved this problem by following method. not sure this will be a good solution or not. any way i could solve the issue.
I'm posting this as a answer. so it will be useful to everyone who has the same issue.
1) Deleted go-ipfs folder inside the "%GO_WORKSPACE% / .... / ipfs" folder.
2) Git clone the go ipfs repo manually on the same location.
3) go inside go-ipfs folder.
4) execute install command.
make install
Done on Windows.
Save IPFS (kubo) to some folder inside %GOPATH% (I cloned https://github.com/ipfs/kubo) to folder %GOPATH%\kubo
Important cd %GOPATH%\kubo\cmd\ipfs\
go install
ipfs.exe was placed in %GOPATH%\bin
I launched it as daemon - works.
BTW: GOROOT is defined and path to go is included in PATH

gendef returning invalid syntax error

I am trying to install Theano for machine learning on my Windows 7 computer.
One of the last steps in installing the dependencies is to 'create a link library for GCC' by 'Opening up the Python shell and cd to C:\SciSoft. Then execute:
gendef WinPython-64bit-2.7.9.4\python-2.7.9.amd64\python27.dll
dlltool --dllname python27.dll --def python27.def --output-lib WinPython-
64bit-2.7.9.4\python-2.7.9.amd64\libs\libpython27.a
I've tried doing this but I get a invalid syntax error highlighted on 'WinPython'. I tried changing directory to go deeper and running gendef again and it also returned the same error. This is a copy and paste job from http://deeplearning.net/software/theano/install_windows.html#install-windows
I also followed the tutorial at the link to install Theano.
The line "Finally we need to create a link library for GCC. Open up the Python shell and cd to c:\SciSoft" is probably an error; "the Python shell" should be modified to "cmd.exe".
The two-line scripts are not python scripts, and can be successfully run on cmd.exe after changing directory to c:\SciSoft.

Build R source code from windows

C:\Work\R contains the R-3.1.1.tar.gz file
I have build R source(R-3.1.1) in windows 8 from the following commands
cd C:\Work\R
tar --no-same-owner -xf R-3.1.1.tar.gz
cd C:\Work\R\R-3.1.1\src\gnuwin32\
make all recommended
Add the following path to the Environment variables
C:\Work\R\R-3.1.1\bin\i386
Enter the R.exe in command promt
I got the following Error
Fatal error unable to open the base package
System information
Windows 8, 64 bit operating System, x64 –based processor
How to resolve this error?
If you are using R, you can download the newest version from here and then simply install it.
If you have an older version and want only to download the new one, use those commands inside R:
# installing/loading the package:
if(!require(installr)) {
install.packages("installr"); require(installr)} #load / install+load installr
# using the package:
updateR() # this will start the updating process of your R installation. It will check for newer versions, and if one is available, will guide you through the decisions you'd need to make.
We can resolve this issue by using the following command before build the R source code
Set TMPDIR=c:\cygwin64\bin
Here c:\cygwin64\bin is the cygwin installed location in Windows 8 machine.
Here I have mentioned the R source code build steps:
Install cygwin setup
Install RTools
Create the R_HOME file in the directory like C:\R_HOME
Place the R source code tar file in the R_HOME
Add the following path in environment variable in first
c:\Rtools\bin\;c:\Rtools\gcc-4.6.3\bin;C:\cygwin64\bin\;C:\Program Files (x86)\HTML Help Workshop\;C:\R_HOME\R-3.1.1\bin\;
Enter the following command in the command prompt
Set TMPDIR=C:\cygwin64\bin
Set working directory as C:\R_HOME
Enter the following command
tar --no-same-owner -xf R-3.1.1.tar.gz
Copy the Tcl source from c:\R (it will be created while installing RTools)
Set the working directory as follow in command prompt
C:\R_HOME\R-3.1.1\src\gnuwin32
Enter the following command
Make all recommended
Enter the R.exe command in command prompt. We can enter the R terminal

Error after running build() to create R package in RStudio

I am trying to build an R package using RStudio on Windows 8 Pro. When I attempt to build the package by running build() I get the error:
"C:/Program Files/R/R-30~1.2/bin/x64/R" --vanilla CMD build "H:\File Assembly\FileAssembler" \
--no-manual --no-resave-data
'C:\Program' is not recognized as an internal or external command, operable program or batch file.
Error: Command failed (1)
I already have MiKTEX installed and I have checked this by:
Sys.which("pdflatex")
pdflatex
"C:\\Program Files (x86)\\MIKTEX~1.9\\miktex\\bin\\pdflatex.exe"
The R version I am using is: R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
Loading library(devtools) and running find_rtools(T) gives:
find_rtools(T)
Scanning path...
ls : c:\Rtools\bin\ls.exe
gcc: c:\Rtools\GCC-46~1.3\bin\gcc.exe
VERSION.txt
Rtools version 3.1.0.1942
Version: 3.1
[1] TRUE
In addition, the path for rtools exes are:
Sys.which("ls.exe")
ls.exe
"c:\\Rtools\\bin\\ls.exe"
Sys.which("gcc.exe")
gcc.exe
"c:\\Rtools\\GCC-46~1.3\\bin\\gcc.exe"
And checking the path in R:
Sys.getenv('PATH')
[1] "C:\\Program Files\\R\\R-3.0.2\\bin\\x64;c:\\Rtools\\bin;c:\\Rtools\\gcc-4.6.3\\bin;……other paths…………;C:\\Program Files (x86)\\MiKTeX 2.9\\miktex\\bin\\"
I would really appreciate help with identifying what I have missed out.
This is a common error caused by a space in the install location path (C:\Program Files). The solution, and the official R recommendation is that you never install R in a location with spaces in it on Windows if you want to be able to install packages from source.
from http://cran.r-project.org/bin/windows/rw-FAQ.html#How-do-I-install-R-for-Windows_003f:
If you want to be able to build packages from sources, we recommend
that you choose an installation path not containing spaces.
I had the same problem.
Took some time to find that Rcmd.exe was removed by the Kaspersky antivirus.
once I detected that it was easy to fix.
good luck
Offer

Resources