Failed to run '/usr/local/go/bin/go env. The config change may not be applied correctly - linux

Whenever i try save a go file inside vc code i get this pop up Failed to run '/usr/local/go/bin/go env. The config change may not be applied correctly. . Also there is any no go intelliSense, code navigation, and code editing support.

I guess, you are using go modules and have go.mod file inside project directory. In this case, inside VsCode, go to preferences. Under extensions, select Go. Untick checkbox labelled "Infer GOPATH from the workspace root." for both "User" and "Workspace".
Close all terminal and VsCode instance, and restart VsCode. It should no longer display the error, and prompt message to install Go Tools. Else you can manually install go tools from VsCode (pressing crtl/cmd + shift + P), which will bring back intellisense and linting.

In case you are using Mac OS and installed Go via homebrew add
"go.goroot": "/opt/homebrew/opt/go/libexec"
To your settings.json file. The path may be different. Check it via export GOROOT="$(brew --prefix golang)/libexec".
Also see install go on mac

I have solved this issue. The solution is that, create a new Golang project and move all the required logic files from older project to newer project and it will work. The problem is with .mod and .sum files. It is a older project that i have created on my other laptop that has Ubuntu based Feren OS. When I moved this project to my newer laptop that has Ubuntu based Zorin OS. It creates problem. So after trying lots of solution, I just created a new Golang project and moves all the required files and it works.

Related

Google images search API raising ModuleNotFoundError for curses on windows [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 run cmder from start menu

I have been vexed by what I felt should be an easy issue to solve. I have been trying to run the cmder executable from the start menu. But when I type the Cmder in the Run box, Cmder.exe does not show up in the list
But I can see from the cmd that Cmder.exe is present and when I run that exe in cmd , Cmder opens up.
Is there some reason that Cmder.exe does not appear in my start/run command?
Thanks in advance
The reason for this is that Cmder isn't installed like a typical Windows application.
The solution is to add Cmder to your computer's path. See Henrik Sommerfeld's blog post.
Additionally, if you're interested in learning more about what is being used for your searches, click the Filters button. See image below:
Instead of using the Start Menu, install Keypirinha. Then add the folder where you store Cmder and similar tools, to the Keypirinha and you can get rid of the Start Menu.
Keypirinha is faster and much more flexible than the Start Menu - e.g. let you pick the apps from somewhere on your machine.
I have a lot of XCopy-deployable tools like Cmder (and Keypirinha too) in an "Application" Git repository. If I have to provision a new developer machine with all the beloved developer tools, now the fast way is:
install Chocolatey
install Git Extensions via Chocolatey
clone my "Application" Git repository
This a done in less than 10 minutes and it covers 95% of my toolset.
To have CMDER on Windows Context Menu (right click) wherever you want.
Open a terminal as an Administrator
Navigate to the directory you have placed Cmder
Execute .\cmder.exe /REGISTER ALL
If you get a message "Access Denied" ensure you are executing the command in an Administrator prompt.
In a file explorer window right click in or on a directory to see "Cmder Here" in the context menu.
From: https://github.com/cmderdev/cmder#shortcut-to-open-cmder-in-a-chosen-folder
Tip: put the CMDER files in c:\Program Files\CMDER

Getting the targetdir variable must be provided when invoking this installer while installing python 3.5

I have Python 2.7 on my Window 7. Problem is with python 3.5 and 3.6 version only.
Hey just right click on exe file and run as a administrator.It worked for me :)
There are 2-3 ways to solve the issue:
As suggested above, Right-click on exe file and run as administrator.
Open command prompt in administrator mode.
Just take a note of where your setup file location is present.
Use cd C:\Users\ABC\Downloads
Type C:\>python-3.7.0.exe TargetDir=C:\Python37
Note: my setup file was python-3.7.0.exe
Follow the steps
3.Please try to do the custom installation and choose a clean folder location. In custom installation, we can tick or un-tick some option. Choose only 1/2 option which are required. Leave rest. Sometimes this troubleshoot step also help to install.
4.Go to properties of python Setup file. Go to advance setting and change the owner to administrator. Also go to compatibility and tick on "Run as administrator"
This worked for me.
Right Click on the setup file and Run as administrator

Package installed by Nix not in Mate desktop menu

I have used Nix package manager to install Abiword in a Slackware/Salix install with Mate desktop. The application runs fine but it has not appeared in the main Menu. Is this usual for applications installed by Nix?
I got this working on openSUSE plasma-desktop by adding the following to my bashrc
export XDG_DATA_DIRS=~/.local/share/:~/.nix-profile/share:/usr/share
cp -f ~/.nix-profile/share/applications/*.desktop ~/.local/share/applications/
Then logging out or running kbuildsycoca4 rebuilds the start menu.
When I only set the XDG_DATA_DIRS, the icons would appear in the start menu. However kdelibs is trying to make those .desktop files executable and add a xdg-open shebang to them, which does not work since .nix-profile is not writeable.
Thus it was also necessary to copy the desktop files to a ~/.local/share/applications/, which however also needs the XDG_DATA_DIRS set to ~/.nix-profile, because the application icons still reside there.

PhpStorm terminal npm (node)

I've just recently started using gulp.js in my projects and I've been trying to learn and use terminal a lot more.
When I run npm commands from the mac terminal default console everything works great however when I run the same commands in PhpStorm the command is not found.
I've followed PhpStorm's guides on installing and integrating the NodeJS plugin etc but I cant seem to get any of the commands to work through it even though its in my usr/local/bin and was installed globally etc.
When I SSH to vagrant though I can use the npm commands etc. Would anyone happen to be able to suggest anything?
This one is quite old but I came across the same problem.
What I did was enter the terminal settings under tools > terminal, go to Application Settings, and change the Shell path to the one you need.
Click the ... button and select the one that suits you.

Resources