How to install Torch on Windows 10? - windows

I try to install Torch on Windows 10 using this instruction. I followed most steps without any problems, but stumbled here:
Generate user.lua file in C:\Users\Name.zbstudio:
path.lua = [[C:\app\tools\torch\bin\luajit.exe]]
The latest version of Zero Brane Studio doesn't create '.zbstudio' subfolder in 'C:\Users\'. Instead there's a 'zbstudio' subfolder inside an installation directory (app.lua and config.lua lie there by default). I tried to place user.lua in this subfolder, but it didn't help.
Without this step Torch isn't accessible and 'th' command doesn't work.

I think there it a typo in the instructions; it should be C:\Users\<username>\.zbstudio folder. You don't need to guess or know the location of that folder, as if you navigate to Edit | Preferences | Settings: User menu in the IDE, it will open the correct location for user.lua file where you can put your settings.

Related

Install adt Package [duplicate]

In PyCharm, I've added the Python environment /usr/bin/python. However,
from gnuradio import gr
fails as an undefined reference. However, it works fine in the Python interpreter from the command line.
GNURadio works fine with python outside of Pycharm. Everything is installed and configured how I want it.
Gnuradio is located at /usr/local/lib/python2.7/site-packages/gnuradio
Also:
PYTHONPATH=/usr/local/lib/python2.7/site-packages:/usr/local/lib/python2.7/site-packages/gnuradio
Adding a Path
Go into File → Settings → Project Settings → Project Interpreter.
Then press configure interpreter, and navigate to the "Paths" tab.
Press the + button in the Paths area. You can put the path to the module you'd like it to recognize.
But I don't know the path..
Open the python interpreter where you can import the module.
>> import gnuradio
>> gnuradio.__file__
"path/to/gnuradio"
Most commonly you'll have a folder structure like this:
foobarbaz/
gnuradio/
__init__.py
other_file.py
You want to add foobarbaz to the path here.
You should never need to modify the path directly, either through environment variables or sys.path. Whether you use the os (ex. apt-get), or pip in a virtualenv, packages will be installed to a location already on the path.
In your example, GNU Radio is installed to the system Python 2's standard site-packages location, which is already in the path. Pointing PyCharm at the correct interpreter is enough; if it isn't there is something else wrong that isn't apparent. It may be that /usr/bin/python does not point to the same interpreter that GNU Radio was installed in; try pointing specifically at the python2.7 binary. Or, PyCharm used to be somewhat bad at detecting packages; File > Invalidate Caches > Invalidate and Restart would tell it to rescan.
This answer will cover how you should set up a project environment, install packages in different scenarios, and configure PyCharm. I refer multiple times to the Python Packaging User Guide, written by the same group that maintains the official Python packaging tools.
The correct way to develop a Python application is with a virtualenv. Packages and version are installed without affecting the system or other projects. PyCharm has a built-in interface to create a virtualenv and install packages. Or you can create it from the command line and then point PyCharm at it.
$ cd MyProject
$ python2 -m virtualenv env
$ . env/bin/activate
$ pip install -U pip setuptools # get the latest versions
$ pip install flask # install other packages
In your PyCharm project, go to File > Settings > Project > Project Interpreter. If you used virtualenvwrapper or PyCharm to create the env, then it should show up in the menu. If not, click the gear, choose Add Local, and locate the Python binary in the env. PyCharm will display all the packages in the selected env.
In some cases, such as with GNU Radio, there is no package to install with pip, the package was installed system-wide when you install the rest of GNU Radio (ex. apt-get install gnuradio). In this case, you should still use a virtualenv, but you'll need to make it aware of this system package.
$ python2 -m virtualenv --system-site-packages env
Unfortunately it looks a little messy, because all system packages will now appear in your env, but they are just links, you can still safely install or upgrade packages without affecting the system.
In some cases, you will have multiple local packages you're developing, and will want one project to use the other package. In this case you might think you have to add the local package to the other project's path, but this is not the case. You should install your package in development mode. All this requires is adding a setup.py file to your package, which will be required anyway to properly distribute and deploy the package later.
Minimal setup.py for your first project:
from setuptools import setup, find_packages
setup(
name='mypackage',
version='0.1',
packages=find_packages(),
)
Then install it in your second project's env:
$ pip install -e /path/to/first/project
For me, it was just a matter of marking the directory as a source root.
Add path in PyCharm 2017
File -> Settings (or Ctrl+Alt+S) -> Project -> Project Interpreter
Show all
Select bottom icon on the right side
Click on the plus button to add new path to your module
My version is PyCharm Professional edition 3.4, and the Adding a Path part is different.
You can go to "Preferences" --> "Project Interpreter". Choose the tool button at the right top corner.
Then choose "More..." --> "Show path for the selected interpreter" --> "Add". Then you can add a path.
DON'T change the interpreter path.
Change the project structure instead:
File -> Settings -> Project -> Project structure -> Add content root
In PyCharm 2020.1 CE and Professional, you can add a path to your project's Python interpreter by doing the following:
1) Click the interpreter in the bottom right corner of the project and select 'Interpreter Settings'
2) Click the settings button to the right of the interpreter name and select 'Show All':
3) Make sure your project's interpreter is selected and click the fifth button in the bottom toolbar, 'show paths for the selected interpreter':
4) Click the '+' button in the bottom toolbar and add a path to the folder containing your module:
For PyCharm Community Edition 2016.3.2 it is:
"Project Interpreter" -> Top right settings icon -> "More".
Then on the right side there should be a packages icon. When hovering over it it should say "Show paths for selected interpreter". Click it.
Then click the "Add" button or press "alt+insert" to add a new path.
As quick n dirty fix, this worked for me:
Adding this 2 lines before the problematic import:
import sys
sys.path.append('C:\\Python27\\Lib\site-packages')
On Project Explorer, you can right click on the folder where the module is contained and set as 'Source'.
It will be parsed in the Index for code completion as well as other items.
I'm new to PyCharm (using 2018.3.4 CE) and Python so I rotely tried to follow each of the above suggestions to access the PIL (Pillow) package which I knew was in system-site-packages. None worked. I was about to give up for the night when I happened to notice the venv/pyvenv.cfg file under my project in the Project Explorer window. I found the line "include-system-site-packages = false" in that file and so I changed it to "true". Problem solved.
In my PyCharm 2019.3, select the project, then File ---> Settings, then Project: YourProjectName, in 'Project Interpreter', click the interpreter or settings, ---> Show all... ---> Select the current interpreter ---> Show paths for the selected interpreter ---> then click 'Add' to add your library, in my case, it is a wheel package
For me there is also another issue. If you try to add a folder that in the past had a .idea folder, but your current project has it's own .idea folder your pycharm might get confused for some reason -- even if you have the right python/conda env. For me deleting the .idea folder of the other project fixed the confusion that it could find the obviously correctly installed pkgs. Then it was it was able to find them in the pycharm editor GUI snf stopped underlyinging them in red.
Download anaconda
https://anaconda.org/
once done installing anaconda...
Go into Settings -> Project Settings -> Project Interpreter.
Then navigate to the "Paths" tab and search for /anaconda/bin/python
click apply

How to use autopep8 to format code in Spyder / Anaconda

I have been looking for the correct installation instructions to properly install Spyder with Anaconda and then use the autopep8 plugin to format my python code when I am working on Spyder. I was not able to find a single place with the proper procedure. Nevertheless, after spending several hours reading the instructions for Spyder Plug-In installation as well as the GIT autopep8 repository, I was still not certain on the proper procedure. Most of theinstructions pointed to the Spyder plugin directory as the location to drop the autoprep8 code but that did not work either.
So, what is the actual procedure or process to install autoprep8 as a working plugin on Spyder that is part of the Anaconda3 platform?
This was a complicated and difficult process to decipher. Several recommendations and observations were found on Google Search with no level of success. I was getting discouraged and almost disappointed that I could not find the answer.
I kept searching and found a clue at the Anaconda Site where I read that Anaconda site-packages folder is the place to drop the files. So, I wanted to share my findings so other programmers can quickly install the autopep8 plugin and get on to the fun part of coding their python projects.
When you are ready to install your Anaconda Programming environment, head on to the Anaconda Web Site and make sure you look for and select the 64 bit version for your OS version. You will find the 32 bit and 64 bit versions under the Download button.
Then install Anaconda and Select to install it for All Users (important tidbit). The remaining default installation is fine. It will take a few minutes to install everything, so go get your beverage of choice and wait for it to complete. Once it is done, head on to the autopep8 GIT repository and download the master files. There are several instructions on this step and multiple repositories, including a pip install version; none of them worked for me, until I found the version from the REPO link that I provided...
From the GIT repo link, select to download the Zipped master package. Unzip the package and navigate to to the directory where you'll find the spyder_autopep8 sub folder.
Open a new Windows Folder and manually type in the following director:
C:\Users\All Users\Anaconda3\Lib\ Scroll down the list until you find the site-packages folder. leave it there...
Now, return to the autopep8 folder and Right-Click / copy the spyder_autopep8 directory. Return to the Anaconda3\lib folder area; Right-Click on the site-packages folder / Paste to drop the spyder_autopep8 folder into it. It should only take a second to do this. Double-click on the site-packages folder and confirm that the spyder_autopep8 folder exist on the list of folders. You should see it among the spyder folder group, for there are at least seven folders that starts with spyder_xxxx, and one spyder main folder.
Once you confirm that the folder exists, close the windows Explorer windows and launch Anaconda3. Spyder should be on the list; launch it. Verify that the autopep8 link exists under the Source menu link of Spyder. It should be listed as: Run autopep8 code autoformating
I hope this post will help to reduce wasted time and effort in locating the proper installation of autopep8 on Spyder.

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

How to install plugin for MobaXterm?

I need a terminal that will support svn on windows and I found that MobaXterm is one of them. However going to their plugin installation page which says:
To install these plugins, just download them and put them in the same directory than the MobaXterm executable.
So I downloaded it and put it in the file
C:\Program Files (x86)\Mobatek\MobaXterm Personal Edition however I still get the error message
Sorry: Svn is not included in this version of MobaXterm.
You can check online if you find a Svn plugin for MobaXterm
by ctrl+clicking here: http://mobaxterm.mobatek.net .
If you need a custom version of MobaXterm that includes Svn,
do not hesitate to ask us for a quotation: mailto:contact#mobatek.net .
Does anyone have experience with this software or recommended a terminal that can support svn in windows?
You need to go into the C:\Program Files (x86)\Mobatek\MobaXterm Personal Edition or whichever edition you have and place the plugin there. Restart MobaXterm and it should work.
I normally collect all the plugins which I require from http://mobaxterm.mobatek.net/plugins.html
Once the .mxt3 files are getting downloaded, I moved them to the installed folder where the MobaXterm_.exe is there.
After restarting MobaXterm, this will work like a champ.
Hope if this solves your issue faster.
Start MobaXterm terminal.
Type MobApt or apt-get. This will open MobApt package manager.
Once in the package manager, you have a variety of tools/commands that you can install by simply selecting and pressing Install/Update.
i know the question is old. but you should put the plugin into your home.
if you check the setting you see this is the home directory
%CurrentDrive%:\Users\USERNAME\Documents\MobaXterm\home
witch is :
C:\Users\USERNAME\Documents\MobaXterm\home -- or whatever drive that u installed windows
i just installed the python plugin and it works fine
In Mobaxterm simply type : apt-get install subversion
Usable just right after installation. No need to restart.
Same for git.
Change the name of the .mxt3 file (that you downloaded) to .zip
Extract the files, get the .exe files you want from the bin folder
from the files you just extracted, and add them to the slash/bin
folder of the Mobaxterm (where there are more .exe files)
Restart
In order to finish your plugin installation, you need to restart MobaXterm. After restarting, type "svn" in the terminal and it should work.
Try run the command:
#unalias svn
When I saw $PATH and looked into its directories, there was no git.exe.
I downloaded git.mxt3 and put in program files (86) folder and restarted mobaterm.
After restart I can see a file named git.exe in my /bin folder. I am using Win7 (64 bit) and mobaXterm personal Edition v7.1 installed using windows installer (not portable )
MobaXterm already has a 'Packages' button where you can search for plugins and download them. You don't need to go to github and other places to find the necessary files. Just using the built-in search feature under the 'Packages' option at the top of MobaXterm.

Advanced Installer Mystery File/Folders

Using Advanced Installer. When I build and run my install project, after the install there is a folder called MyCompany (equivalent to [Manufacturer]) located within the ApplicationData folder (which resolves to C:\Users\Joey\AppData\Roaming\ on my system).
Within that particular folder is another folder called MyProgram 1.0.0 (equivalent to [ProductName] [ProductVersion].
And within that folder is another folder called install. And within that folder is a file called setup.msi with a size of 1.17MB
I have no understanding of why this file and these folders are being created. Further, after I uninstall my app, they get left behind on the system, which means my app is creating garbage.
Can someone please explain why this is happening? And also...if I can't cause this to not be present in the file system while my app is installed, how can I avoid leaving it behind on the file system after I uninstall?
Thanks.
When you are building an EXE setup file, that is the default extraction folder for the EXE, where you can find all the resources during the installation. You can change it from Media page, "Extraction folder".
It is not deleted after uninstall due a bug in Advanced Installer, you can find more details and a workaround on the forums.

Resources