I have installed this CLI - https://stacked.filledstacks.com/docs/getting-started/overview
The downloaded file is saved in this folder user/.pub-cache/global_packages
When I typed stacked create app my_first_app
I got this error -bash: stacked: command not found
I can see that I added the path when I typed echo $PATH
From my terminal:
echo $PATH
/opt/homebrew/opt/dart#2.16/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/alexa/opt/anaconda3/bin:/Users/alexa/opt/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/Cellar/ruby/2.5.1/bin:/Applications/XAMPP/xamppfiles/bin:/Applications/XAMPP/xamppfiles/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/XAMPP/xamppfiles/bin:/Users/alexa/.pub-cache/bin:/Users/alexa/Developer/flutter/bin
this is the path I added :/Users/alexa/.pub-cache/bin:
My login shell is /bin/bash and I saved the path to nano ~/.bash_profile
I have fixed it...looks like the problem was I didn't install the latest version of the CLI because I was using an older version of the Dart SDK. My Dart SDK was updated but I had to remove the path referencing the older version of the Dart SDK.
Specs
VSCode 1.63.2
Homebrew 3.3.10
asdf 0.9.0
MacOS Monterey
Problem
I installed asdf via Homebrew as per doc http://asdf-vm.com/guide/getting-started.html#_3-install-asdf
The asdf command works well in my iTerm. However, it didn't work when committing or pushing via VScode terminal and VSCode source control.
The error from VSCode terminal
Unknown command: `asdf exec npm run pre-commit`
/usr/local/Cellar/asdf/0.9.0/libexec/bin/asdf: line 82: /usr/local/opt/asdf/lib/commands/command-help.bash: No such file or directory
And this below from VSCode source control
The error I got in output.
> git push origin feature/my-branch
Unknown command: `asdf exec npm run pre-commit`
/usr/local/Cellar/asdf/0.9.0/libexec/bin/asdf: line 82: /usr/local/opt/asdf/lib/commands/command-help.bash: No such file or directory
Running asdf exec npm run pre-commit in my iTerm works well. There must be different configuration between zsh in iTerm vs in VSCode. 🤔
My attempt so far is to add this configuration in VSCode settings.json
"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.defaultProfile.osx": "zsh"
but still not working
My ~/.zshrc setup for asdf
. /usr/local/opt/asdf/libexec/asdf.sh
What is the possible cause here?
Found dubious decision
I also dont have commands folder in asdf/lib
So I copied the same from asdf/libexec/lib
And it worked
I keep getting this error when I run: code . on MacOS terminal
-bash: code: command not found
-bash: code: command not found image
Reading through the launching-from-the-command-line section of VS Code official documentation answers this question.
Steps
Launch VS Code
Open the Command Palette (F1) and type 'shell command' to find the Shell Command: Install 'code' command in PATH command.
Restart the terminal for the new $PATH value to take effect. You'll be able to type 'code .' in any folder to start editing files in that folder.
I'm trying to install flutter on ubuntu 18.04. After downloading the flutter package from link, I set the PATH variables, after that whenever I try to execute flutter on terminal it was giving an error command not found.
Even I try to execute flutter command inside flutter/bin the result remains the same!
I tried to restart and check then also result remains the same.
This is how my .bash_profile looks like
rajath#rajath-Inspiron:~/Downloads/flutter/bin$ cat ~/.bash_profile
export JAVA_HOME=/usr/lib/jvm/default-java
export ANDROID_HOME=/opt/Android
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=/Downloads/flutter/bin:$PATH
Error log:
rajath#rajath-Inspiron:~/Downloads/flutter/bin$ flutter doctor
flutter: command not found
rajath#rajath-Inspiron:~/Downloads/flutter/bin$ flutter
flutter: command not found
rajath#rajath-Inspiron:~/Downloads/flutter/bin$
Any kind of help will much much appreciated!!!
You can also add export PATH=$PATH:~/Downloads/flutter/bin to your ~/.bashrc.
That will add the flutter path to your path variable everytime you start a new bash.
And maybe you should install flutter anywhere near /usr/
As worldpotato said, You must add to your .bashrc file (or .bash_profile)
You can run the command
echo 'export PATH="$PATH:~/Downloads/flutter/bin"' >> ~/.bashrc
and
echo 'export PATH="$PATH:~/Downloads/flutter/bin"' >> ~/.bash_profile
On Windows 10.
I did this:
pip install autopep8
and in vscode user settings I have
"python.linting.pep8Enabled": true,
"python.formatting.provider": "autopep8",
When I run format document, or explicitly invoke autopep8 from the command pallette, the error is:
Error: Command failed: autopep8 c:\tca-backend\lambdas\utilities\NetMenuAPIUtil.py
'autopep8' is not recognized as an internal or external command,
operable program or batch file.
Clearly, vsc wants to invoke autopep8.exe but there is no exe. Just py. So I created a autopep8.bat which works when I test from the command line, but when run from vsc, it inserts the content of the batch file into the top of the document. (Yes, that's as strange as it sounds.)
All other Python-related operations work ok, including the ESLint extension.
VS code Python extension supports source code formatting using either autopep8 (the default), black, or yapf so you don't need to install python formatting tools by yourself.
The way I use formatting is to set a shortcut in vs code.
Go to File -> Preferences -> Keyboard Shortcuts, then search format. Set the shortcut as ctrl + shift + p which is the same as the shortcut of autopep8 or you can set any combination you prefer.
Click the shortcuts in your .py files then you will get the formatted code.
Ref: https://code.visualstudio.com/docs/python/editing
Since you are using VSCode on Windows, please click on the Terminal Section and type
pip install pep8
This will start installing pep8.
for me, the autopep8 doc installation isn't enough, still seeing this error, I had to follow this https://pip.pypa.io/en/latest/user_guide/#user-installs. it works like a charm.
I'm on windows so I used this:
py -m pip install –-user autopep8
You need to add this as a PATH under System Environment Variables:
c:\users\<username>\appdata\roaming\python\python39\site-packages
Then close and restart VS Code. Type autopep8 at a terminal prompt and you should see this:
C:\Foobar>autopep8
usage: autopep8 [-h] [--version] [-v] [-d] [-i] [--global-config filename] [--ignore-local-config] [-r] [-j n] [-p n] [-a] [--experimental] [--exclude globs] [--list-fixes] [--ignore errors] [--select errors]
[--max-line-length n] [--line-range line line] [--hang-closing] [--exit-code]
[files ...]
autopep8: error: incorrect number of arguments
I encountered an error message while trying to do same and below was what I did (in my terminal):
Install or upgrade pep8:
pip install --upgrade autopep8
Navigate to the folder/directory where the file you need formatted is, then use the following command:
autopep8 --in-place file_name
There you have it!
I encountered this same error running WSL: Ubuntu-20.04, well this was my solution:
$ pip --version
This will make you verify that you have python3 pip installed correctly in your distribution, if that's not the case, it will pop up an error:
Command 'pip' not found, but can be installed with:
apt install python3-pip
Just run the indicated command to installed it and then after that, run:
$ python3 -m pip install autopep8
Now everything should be working as it should, including the formatting autpep8.