LuaRocks can't find luarocks.lua - windows

I've been having difficulties getting luarocks to work in Windows 7. Whenever I run luarocks, I get the following error:
lua5.1: cannot open C:\Program Files (x86)\Lua\luarocks.lua: No such file or directory
Now, checking the folders, it is indeed the case that luarocks.lua is not in C:\Program Files (x86)\Lua, but in C:\Program Files (x86)\Lua\5.1. I don't know where or what file I have to change to get that to work. I installed with the /MW /L /F options in case that matters, but I've had the same problem installing without options. The documentation has not been much help, and I've set all my path variables correctly, in accordance with the text dump at the end of the install. I got no errors during the install. I installed the latest version of luarocks, 2.2.0.

The full path to luarocks.lua is written into the generated luarocks.bat by the installation script. You could change it there, but it looks like your LuaRocks installation is seriously broken: luarocks.lua should not be in C:\Program Files (x86)\Lua\5.1 but in C:\Program Files (x86)\LuaRocks\2.2, next to luarocks.bat. (The LuaRocks version number, 2.2 in this case, is appended to the install location automatically by the installation script, so I have no idea how you could end up with a path like yours.) You will most likely run into more problems along the way. This is also the reason why your bundled tools could not be found before.
It could be something simple like another failed installation attempt that interferes because of leftover environment variable settings, but I suggest you show up on the LuaRocks mailing list (also accessible as a newsgroup), and post your solution here at SO once the underlying problem is resolved.

Related

pycharm swig how to? [windows]

I would require some guidance in regards to installing a module/package in pycharm (free edition). I have to mention that i have not worked with this IDE yet and wanted to try it out on a little project containing smartcards.
When i try to install "pyscard" i get the error that boils down to
error: command 'swig.exe' failed: No such file or directory
People say just install SWIG, which i guessed already ^^.
The issue i have is that i actually have no idea how to... and none of the pages i found has really enlightended me on this issue.
I downloaded the zip "swigwin-3.0.12" but i am at a loss what to do with it now. EDIT: According to the SWIG page this is an already compiled version and i have to somehow make pycharm recognize that the folder it is in contains the swig.exe it requires.
EDIT2: Adding the folder containing the swig.exe to the PATH variable also did not work ... which i thought would be the issue
EDIT3+Answer:
Ok the link in the comments from "wp78de" was correct my problem was that pycharm/pc restart were needed for it to catch the added PATH variable to the swig.exe (for pycharm that is)
Any advice is appriciated.
Envoirment:
Windows 8.1 Pro 64-bit
Pycharm 2017.2.4
Python 3.6
Basically, you just have to add the directory that contains the swig executable the PATH environment variable. You can do it via CMD or the Windows UI.
If you have added swig to your path, you should be able to call it in the command prompt from any directory: open "cmd", and type swig --help" on that prompt.
A restart of PyCharm (or whatever your IDE is) and Windows might be required.

mingw-w64 installer "the file has been downloaded incorrectly"

I am trying to install mingw-w64 onto Windows. However I receive an error, "the file has been downloaded incorrectly". Redownloading the setup file again from sourceforge does not fix the problem. Is there an alternative way to install it or am I doing something wrong?
Old post but same problem, the installer doesn't seem to work.
I give the solution which works for me
You can directly download the archive of MinGW64 with your chosen configuration :
https://sourceforge.net/projects/mingw-w64/files/mingw-w64/
Once the compressed file downloaded, you have just to extract and copy/paste the MinGW64 folder( with the pre-compiled librairies) to your chosen folder ( in my case : C:\mingw64)
I got same error and solved it, after struggling a few hours. You should download MinGW64 via https://winlibs.com/#download-release.
After downloading, You should unzip mingw64 file to a folder(in my case I unzipped it to c disk; C:\mingw64)
And then you have to set up path. for that follow below steps;
open settings.
Search for Edit environment variables for your
account.
choose path variable and then select edit.
Select New and add the Mingw-w64 folder path(bin folder). In my case, I added (C:\mingw64\bin).
Select OK to save the updated path.
And reopen your cmd, then check if everything is good by typing; gcc --version
Long story short, the official installer is broken and not been fixed for years, so we have to install it manually.
The official download link above would bring you to sourceforge: https://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win32/Personal Builds/mingw-builds/installer/mingw-w64-install.exe
And in the same folder that contains the installer, there's a repository.txt. (about this file)
Take a look at it, the installer basically just download and unzip the build from one of these urls within repository.txt. Choose the url you want and download/upzip it manually. (In my case, I use 8.1.0|x86_64|posix|seh|rev0 setup)
Last, setup the Path environment variable pointing to your unzipped bin folder, let say C:\mingw64\bin, and this should do the trick.
Finally, I solved this problem by downloading this:http://winlibs.com/
GCC 10.1.0 + LLVM/Clang/LLD/LLDB 10.0.0 + MinGW-w64 7.0.0 - release 3 (LATEST)
Win32: 7-Zip archive* | Zip archive
Win64: 7-Zip archive* | Zip archive
and set the %path%
After that, I still can't execute gcc correctly, but then I solved the problem by adding this environment variable:
"CGO_ENABLED=1"
I encountered the problem when using this golang package: https://github.com/mattn/go-sqlite3
I received the same error. When I re-ran the installer as an adminstrator it was installed successfully.
I also made sure not to add any spaces to the installation path.
Following this tutorial helped me manually install MinGW for windows : youtube
So the problem for me was that when I tried to use the .exe installer, it either showed me that,
"the file has been downloaded incorrectly" , or , the /.../bin folder did not have any files in it.
In the link above, the MinGW files (including the /bin files) were manually downloaded and identified properly by the Environment Variables.
The problem is with your internet connection and/or ISP. I'm not great at networking so I'll let others be more specific. I tried installing/downloading it using my mobile's data as wifi hotspot and it worked. Hope it helps

Google Cloud SDK installer fails to complete component installation on Windows 7

During installation I get a message:
Unfortunately, the component installation did not complete successfully. Please check the detailed logs for the error message.
I tried installing to all users, single user, many destinations and names.
Details:
Output folder: C:\Program Files (x86)\Google\Cloud SDK
Downloading Google Cloud SDK core.
Extracting Google Cloud SDK core.
Create Google Cloud SDK bat file: C:\Program Files (x86)\Google\Cloud SDK\cloud_env.bat
Installing components.
The filename, directory name, or volume label syntax is incorrect.
Failed to install.
What to do?
for some reason it seems it doesn't like the spaces in the path. Change to other path without spaces: like C:/some/folder/with/no/spaces/cloud-sdk
The 'find' command is a standard Windows command which has been around since the days of DOS. If it doesn't exist on your system, this usually means your PATH is broken or someone has deleted 'find.exe' from C:\Windows\System32. In either case it's not an issue with the Cloud SDK installer.
If you still have 'find.exe' in C:\Windows\System32, you can check your PATH variable and add 'C:\Windows\System32' back to it if it's not included.
Source: https://issuetracker.google.com/issues/35907845
I got the same error when installing it yesterday and I tried a different sets of solutions for this.
I created a find.exe path in my PATH variable
I also created a CLOUDSDK_PYTHON path in my environment variable
I tried uninstalling Python (2.7.14, I think) and re-installing it.
I redirected the path where the SDK is going to be installed to. The default path was C:\Program Files (x86)\Google\Cloud SDK\. I just removed the space on CloudSDK and it installed right after.
Hope this helps.
It is a space issue in Cloud SDK folder/directory path, google cloud sdk installer adds default path as
C:\{USER_DIR}\Google\Cloud SDK
So remove space between Cloud and SDK or change path to different folder without spaces, it should work fine.

Don't get GraphViz and phpDocumentor to work

I'm trying to create a php documentation on my local XAMPP host (on Windows 7) with phpDocumentor.phar (v2.). It gives me (after parsing all the files) this error:
Unable to find the dot command of the GraphViz package. Is GraphViz correctly installed and present in your path?
I searched a lot, but nothing helps. What does 'path' means? If I open a command box at any location I can start the dot.exe (which gives me no output but waiting prompt). In my environment path variable the bin folders is added. GraphViz is installed correct in Program Files and runs standalone.
What could I do or check?
In order to get GraphViz running properly with a Windows based phpdoc installation, just put the GraphViz program directory (c:\some\path\graphviz\release\bin) to the Windows Path system variable.
In order to do this, follow these steps (Win7, please provide your OS version if this doesn't apply to your situation):
From the desktop, right-click My Computer and click Properties.
In the System Properties window, click on the Advanced tab.
In the Advanced section, click the Environment Variables button.
In the Environment Variables window, highlight the Path variable in the Systems Variable section and click the Edit button.
Different directories are separated with a semicolon:
C:\Program Files;C:\Winnt;C:\Winnt\System32
It will most likely look a bit different in your enviroment, so please just take this for an example. Just add the GraphViz Path at the end like this:
C:\Program Files;C:\Winnt;C:\Winnt\System32;C:\somefolder\graphviz\release\bin
I'm not too sure if you have to reboot your system after changing this value. You had to do this in the old days of Win2k, and I just don't know if this still applies to modern Windows versions. It surely doesn't hurt!
After this, phpdoc should be able to find the dot command.
The steps to resolve this error are:
download Windows Packages from
https://graphviz.gitlab.io/_pages/Download/Download_windows.html
Just install it
add c:\Program Files\Graphviz*\dot.exe or c:\Program Files (x86)\Graphviz*\dot.exe to your environment variable PATH
run phpdoc
Re-start your machine & run phpdoc (if still shows the same error message)

How to install pkg config in windows?

I am trying to do it, but all I can get is some source code that I don't know how to do deal with I downloaded from http://pkgconfig.freedesktop.org/releases/.
This is a step-by-step procedure to get pkg-config working on Windows, based on my experience, using the info from Oliver Zendel's comment.
I assume here that MinGW was installed to C:\MinGW. There were multiple versions of the packages available, and in each case I just downloaded the latest version.
go to http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/
download the file pkg-config_0.26-1_win32.zip
extract the file bin/pkg-config.exe to C:\MinGW\bin
download the file gettext-runtime_0.18.1.1-2_win32.zip
extract the file bin/intl.dll to C:\MinGW\bin
go to http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28
download the file glib_2.28.8-1_win32.zip
extract the file bin/libglib-2.0-0.dll to C:\MinGW\bin
Now CMake will be able to use pkg-config if it is configured to use MinGW.
Get the precompiled binaries from http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/
Download pkg-config and its depend libraries :
pkg-config_0.26-1_win32.zip
glib_2.28.8-1_win32.zip
gettext-runtime_0.18.1.1-2_win32.zip
A alternative without glib dependency is pkg-config-lite.
Extract pkg-config.exe from the archive and put it in your path.
Nowdays this package is available using chocolatey, then it could be installed with
choco install pkgconfiglite
I did this by installing Cygwin64 from this link https://www.cygwin.com/
Then - View Full, Search gcc and scroll down to find pkg-config.
Click on icon to select latest version.
This worked for me well.
I would like to extend the answer of #dzintars about the Cygwin version of pkg-config in that focus how should one use it properly with CMake, because I see various comments about CMake in this topic.
I have experienced many troubles with CMake + Cygwin's pkg-config and I want to share my experience how to avoid them.
1. The symlink C:/Cygwin64/bin/pkg-config -> pkgconf.exe does not work in Windows console.
It is not a native Windows .lnk symlink and it won't be callable in Windows console cmd.exe even if you add ".;" to your %PATHEXT% (see https://www.mail-archive.com/cygwin#cygwin.com/msg104088.html).
It won't work from CMake, because CMake calls pkg-config with the method execute_process() (FindPkgConfig.cmake) which opens a new cmd.exe.
Solution: Add -DPKG_CONFIG_EXECUTABLE=C:/Cygwin64/bin/pkgconf.exe to the CMake command line (or set it in CMakeLists.txt).
2. Cygwin's pkg-config recognizes only Cygwin paths in PKG_CONFIG_PATH (no Windows paths).
For example, on my system the .pc files are located in C:\Cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\lib\pkgconfig. The following three paths are valid, but only path C works in PKG_CONFIG_PATH:
A) c:/Cygwin64/usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig -
does not work.
B) /c/cygdrive/usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig -
does not work.
C) /usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig - works.
Solution: add .pc files location always as a Cygwin path into PKG_CONFIG_PATH.
3) CMake converts forward slashes to backslashes in PKG_CONFIG_PATH on Cygwin.
It happens due to the bug https://gitlab.kitware.com/cmake/cmake/-/issues/21629. It prevents using the workaround described in [2].
Solution: manually update the function _pkg_set_path_internal() in the file C:/Program Files/CMake/share/cmake-3.x/Modules/FindPkgConfig.cmake. Comment/remove the line:
file(TO_NATIVE_PATH "${_pkgconfig_path}" _pkgconfig_path)
4) CMAKE_PREFIX_PATH, CMAKE_FRAMEWORK_PATH, CMAKE_APPBUNDLE_PATH have no effect on pkg-config in Cygwin.
Reason: the bug https://gitlab.kitware.com/cmake/cmake/-/issues/21775.
Solution: Use only PKG_CONFIG_PATH as an environment variable if you run CMake builds on Cygwin. Forget about CMAKE_PREFIX_PATH, CMAKE_FRAMEWORK_PATH, CMAKE_APPBUNDLE_PATH.
Install mingw64 from https://sourceforge.net/projects/mingw-w64/. Avoid program files/(x86) folder for installation. Ex. c:/mingw-w64
Download pkg-config__win64.zip from here
Extract above zip file and copy paste all the files from pkg-config/bin folder to mingw-w64. In my case its 'C:\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin'
Now set path = C:\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin
taddaaa you are done.
If you find any security issue then follow steps as well
Search for windows defender security center in system
Navigate to apps & browser control> Exploit protection settings> Program setting> Click on '+add program customize'
Select add program by name
Enter program name: pkgconf.exe
OK
Now check all the settings and set it all the settings to off and apply.
Thats DONE!
Another place where you can get more updated binaries can be found at Fedora Build System site. Direct link to mingw-pkg-config package is: http://koji.fedoraproject.org/koji/buildinfo?buildID=354619
for w64-based computers you have to install mingw64. If pkg-config.exe is missing then, you can refer to http://ftp.acc.umu.se/pub/gnome/binaries/win64/dependencies/
Unzip and copy/merge pkg-config.exe into your C:\mingw-w64 installation, eg. into on my pc into C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin
In 2022 VS Code works with CMake & pkgconfig out of the box (add pkgconf && vcpkg-pkgconfig-get-modules to your vcpkg.json)
From: https://github.com/JoinMarket-Org/joinmarket/wiki/Installing-JoinMarket-on-Windows
This guide describes how to install JoinMarket and its dependencies (python, libsodium, secp256k1) on Windows.
Some or all of this may or may not work for all versions of Windows. Reports appreciated. It is not claimed to be in any way comprehensive. Verification of downloads are your own responsibility.
Install JoinMarket - go to https://github.com/JoinMarket-Org/joinmarket/releases and download the most recent release. Unzip it into any location you choose.
You will need to install MinGW from here or go to their website. After a few introductory screens, you will be shown a windows with some optional components that you have to choose; this basic setup is sufficient:
From "Basic Setup" in the left menu:
mingw-developer-toolkit
mingw32-base
mingw32-gcc-g++
msys-base
Once you have chosen these, choose "Update" from the main menu first item. These components will be installed into C:\MinGW\bin. Once that is complete, you should have this dll: libgcc_s_dw2-1.dll in that folder C:\MinGW\bin, along with a lot of other files; I'm mentioning this file explicitly, since it's needed specifically for libsecp256k1 to operate in this setup.
Next, you must make sure C:\MinGW\bin is added to your PATH variable. Here's one guide to how to do that; you must append ;C:\MinGW\bin to the end of the path before continuing.
Install Python from https://www.python.org/ftp/python/2.7.11/python-2.7.11.msi. Run the executable. Choose to install the feature Add python.exe to Path (it's the last option in the installer, off by default - switch it on) on local hard drive during installation; Python should then be installed in C:\Python27 (EXTRA NOTE: the most recent 2.7 installation linked here seems to install pip automatically, which is very useful for step 4)
Check that Python runs. Open a new command prompt as administrator by typing cmd.exe into the Start menu and pressing Ctrl+Shift+Enter. Type python and you should see something like:
Python 2.7.11 (default....
....
>>>
Exit the Python console with exit() or by pressing Ctrl+C. Now, make sure your version of pip is up to date: run the command: python -m pip install --upgrade pip.
Go to the directory C:\Python27\Lib\distutils and add a new file, called distutils.cfg. Inside it, put:
[build]
compiler=mingw32
Close and save the file.
Next, you need to install the dll for libnacl. First go to https://download.libsodium.org/libsodium/releases/ and choose the file libsodium-1.0.4-msvc.zip to download. Unzip anywhere, and then copy the file libsodium.dll from the directory \Win32\Release\v120\dynamic (do not use v140), and paste it into root joinmarket directory (the same directory where README.md lives). Then you need to address the Visual C++ 2013 runtime dependency. Do so by going to www.microsoft.com/en-us/download/details.aspx?id=40784 and clicking Download. Choose x86 even on a 64-bit system, and run the executable.
Note that after doing this, you must run pip install -r requirements-windows.txt from the Joinmarket root directory (where the README.md file is) and should not get an error message (this will install/check the python packages libnacl and secp256k1(-transient)).

Resources