Edit pycharm interpreter via command line - unix

Is there a way to update/edit pycharm interpreters without the gui? IE editing some configuration file or something?
I am running pycharm community version 2018.2 in unix environment

The pycharm interpreter uses a defined python installation on the machine, either python or anaconda or something. I believe you can update the python via running it from it's installation location and piping or whatever you need from there.

Related

Bad EXE format when running an .exe with wine64 [duplicate]

I'm trying to generate an executable from Linux for Windows using pyinstaller.
pyinstaller --onefile --windowed montecarlo.py
I run this command and get a single executable that works on Linux just fine, but if I try on Windows, it's just a simple file. Why?
I was trying to do this same thing today and ran across this answer. It pointed to the FAQ, which says cross-compiling is not supported. It recommends using Wine.

Using R in Visual Studio Code with conda environment

I would like to use the R environment I installed with conda inside Visual Studio Code (on Macos). First I installed R with conda.
But how do I use/activate the environment in Visual Studio Code? In the settings I can't find the equivalent to "Python: Select Interpreter" or "python.venvPath"
Thanks!
R support in VSCode is handled by a 3rd party extension. The most popular one is R by Yuki Ueda and there is also R Tools by Mikhail Arkhipov
For both of these, you can change the R interpreter to use in the settings.
However, there is no built-in support for Anaconda, mostly because it isn't that popular or necessary in the R community. Most people use the standard R installation instead and most help resources are written for that type of installation: https://cloud.r-project.org/bin/macosx/
It has been 2 years since this entry and the extension still doesn't support conda environments.
For my configuration (I've R installed in a conda environment), I found a pretty painless work around:
open 'vscode'
install the extension and configure it as suggested using the conda paths for both R and, if you have it installed, radian
close 'vscode'
open a terminal
activate your conda environment
start vscode from your terminal using code
After this, everything seems to be up and running correctly. You can start an R terminal using the command palette and, as you run your code, you should be able to see all the information about the environment and namespaces as well as your plots.

Adding the ibapi library to PYTHONPATH module in Spyder (Python 3.6)

I am trying to simply connect to the ibapi (Interactive Brokers API), but I am having some technical troubles with Spyder.
What I did so far:
I installed the latest version for Windows from here
I provided the following path to the PYTHONPATH manager in Spyder: C:\TWS API\source\pythonclient\ibapi afterwards I restarted Spyder
When I simply type import ibapi I get the same error message: ModuleNotFoundError: No module named 'ibapi'
What I am doing wrong here and how can I fix this simple error?
I don't use python very much but I'm pretty sure you have to install the ibapi. I never used the PYTHONPATH and mine works fine in Spyder and Jupyter. I'm using Anaconda.
I run the Anaconda prompt (just activates the conda environment) and navigate to the dir C:\TWS API\source\pythonclient and run python setup.py install
Then everything works. I think many python packages need to be installed like this.
note: That's not my install dir, I just copied yours. There may be a problem with a space in the path. Try renaming to C:\TWSAPI\... if you still have a problem.
Note: after python setup.py install, you might need to restart spyder. If doesn't help, then copy the newly-created ibapi folder to:
C:\Users\iuzeri\AppData\Local\Programs\Python\Python37-32\Lib\site-packages
or
C:\Program Files (x86)\Python37-32\Lib\site-packages
copy your ibapi here
C:/ProgramData/Anaconda3/Lib/site-packages/ibapi

Change terminal in Atom-editor's Platformio-Ide-Terminal on Windows

On Windows, default terminal for Atom's Platformio-Ide-Terminal is Powershell (at least, that is what I get without any configuration).
I would prefer a terminal using unix-type commands. I already have MINGW and CYGWIN installed.
How can I avoid opening a Powershell and opening another terminal type instead?
Set the default shell in:
Edit>>Settings>>Packages>>Platformio Ide Terminal>>Settings>>Shell Override
You can use the git's bash as proposed here as you probably already have git installed.
C:\Program Files\Git\bin\bash.exe
Step by Step Solution
Go the Setting-> Packages -> In Search Bar, search for the platformio.
Open platformio and go to Shell Override Option.
Put the following line as per as your Terminal Requirement
For cmd- C:\\WINDOWS\\System32\\cmd.exe
For Power Shell- C:\\WINDOWS\\Sysnative\\WndowsPowerShell\\v1.0\\powershell.exe
For bash- C:\\Program Files\\Git\\bin\\bash.exe or C:\\Windows\\System32\\bash.exe (depending on how you install the bash). Be Sure, that you have already install the bash into your computer.
Now, you can integrate bash, cmd, git bash, Power Shell into Atom using platformio as terminal.
For CYGWIN users, the bash executable from the following location has proved useful for setting the shell override Settings >> Packages >> Platformio Ide Terminal >> Settings >> Shell Override
C:\cygwin64\bin\bash.exe
If you are now using Ubuntu for Windows 10 (downloaded from the app store), you can change it to that as well.
Ubuntu gets installed in Windows' PATH by default, so just change the default shell to:
ubuntu.exe
That's it. Just remember that to get to your code, cd to /mnt/(driveletter)/wherever/your/files/sit.
For someone who still can't get this to work because your git bash is installed in AppData. This worked for me.
C:\Users\saurabh\AppData\Local\Programs\Git\bin\bash.exe

RStudio not reading system variables when started via launcher

I'm having a few problems with system environment variables with RStudio. In ~/.bashrc some custom environment variables are set which I want to access in my program using Sys.getenv().
When I'm calling Rstudio from the command line, this works fine. However, when I'm using the Ubuntu launch function (Alt+F2) to start RStudio, my environment variables are not found. For portability, I would kind of prefer for this to work, too...
Can someone help?
You need to find Rstudio's desktop launcher. In Ubuntu, launchers are simple text files with the extension .desktop. You can read more about the file format here. The most common locations for these are /home/user/.local/share/applications (user-specific) and /usr/local/share/applications (system-wide). The easiest way to edit these files is to use an app called menulibre.
You can install menulibre by running the following command in the terminal:
sudo apt-get update && sudo apt-get install menulibre
You can then use menulibre to find and edit the Rstudio launcher.
I have just tried using Sys.getenv() on my Rstudio installation, and it works fine. My Rstudio launcher command is /usr/lib/rstudio/bin/rstudio %F
Edit: I am running Rstudio Version 0.99.491

Resources