Unable to run protoc in virtualenv - python-3.x

I am trying to train a tensorflow pretrained model with some data. I have created a virtual environment to manage the versions of libraries properly. However, I am unable to run the 'protoc' command in the virtual environment. It runs fine outside the virtual environment as I have already added the protoc.exe file to path.
This is the error I get :
(environment_3_9_7) PS C:\Users\dipes\Desktop\Computer Vision\Computer Vision Assignment> protoc
protoc : The term 'protoc' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:1
+ protoc
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (protoc:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
How to add the protoc.exe to the path of virtualenv ?

Simply pasting the protoc.exe file in the /Scripts of the virtual environment solved the issue for me.

Related

Python script not running in visual studio code

I am trying to run some python(v=3.11) scripts using visual studio code(v=1.73.1) but doesn't matter what the code is (even just a simple "hello world"). When I type the name of the script in the terminal I get the following error:
PS C:\Users\biagini.WISMAIN\Desktop\PhD project\Python course\Tommaso Biagini_v2> hello.py
hello.py : The term 'hello.py' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:1
+ hello.py
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (hello.py:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Suggestion [3,General]: The command hello.py was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\hello.py". See "get-help about_Command_Precedence" for more details.
I have tried to follow the suggestion but it still doesn't run.
Also what is weird visual studio was working perfectly fine unntill few days ago and now it suddently started to give me this error. Can someone please help me?
I have already tried the suggestion promped by the terminal but it does not work.
You need a Python interpreter to run your code. Try python hello.py if your python interpreter is installed in your environment.

The term 'node' is not recognized as the name of a cmdlet,

PS D:\javascripr\wen_shen_test_package> node hellow.js
node : The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was inclu
ded, verify that the path is correct and try again.
At line:1 char:1
node hellow.js
+ CategoryInfo : ObjectNotFound: (node:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Excuse me ,what can i change for?
You have not installed node.js on your pc.
https://nodejs.org/en/download/
If it is already installed
1.Create index.js file on your desktop and add this code in it:
a=2
b=3
console.log(a*b)
shift+ right click on your desktop, click on open powershell window here.
enter command:
node index.js
it will show the value of a*b
Above given code is an example of how to access particular js file using node

Commands don't work in vscode powershell terminal

I am getting an error similar to this when I try to execute any command in the terminal in vscode. Does anyone know how to solve this problem?
pip : The term 'pip' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.
At line:1 char:1
+ pip install nba_api
+ ~~~
+ CategoryInfo : ObjectNotFound: (pip:String) [], CommandNotF
oundException
+ FullyQualifiedErrorId : CommandNotFoundException
You have to include the path of pip to your PATH environment variable. Powershell or Cmd cannot automatically understand paths. Without enlisting the directory in PATH environment variable, you have to include the full path of the pip command. So you have to use this:
cmd /c "setx.exe PATH %PATH%;ThePathOfPip"
After running this close all instances of powershell and changes will be notable after the next session.
This will also work:
$env:path = $env:path + ";" + "The path of pip"
But it will only save the value for current session and so I don't recommend it.
Wrote this answer using a little from the comment provided link and combining my own knowledge.

Error Python script in atom windows power shell

I am getting error when I am trying to execute a Python script in Atom.
The term 'python' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or
if a path was included, verify that the path is correct and try again.
At line:1 char:7
+ python <<<< .\loading.py
+ CategoryInfo : ObjectNotFound: (python:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException]1
It looks like you have not added the path to Python, in your Environmental Path variable.
Try adding C:\Python36\ and C:\Python36\Scripts\ to the PATH
Add this path to the 'Path' in system variable in environment variables.
C:\Users\%user profile%\AppData\Local\atom\bin
Make sure to use your "user profile" in the path. It worked for me!
Open atom through power shell
Should work

How to fix error when trying to run node web-server.js

I've installed node.js through Win8 powershell and now want to run the web-server.js that comes with the AngularJS tutorial.. however, this time around Windows8 Powershell is behaving differently from my experience in Win7 - I get the following error:
C:\Users\xx\angular-phonecat\scripts [master +24 ~0 -0 !]> web-server.js
web-server.js : The term 'web-server.js' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ web-server.js
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (web-server.js:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Suggestion [3,General]: The command web-server.js was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type ".\web-server.js". See "get-help about_Command_Precedence" for more details.
You have to run using the following command:
node web-server.js
is not recognized as the name of a cmdlet, function, script fil

Resources