当前位置:网站首页>【Power Shell】Invoke-Expression ,Invoke-Expression -Command $activateCommand; Error or power shell failed to activate the virtual environment
【Power Shell】Invoke-Expression ,Invoke-Expression -Command $activateCommand; Error or power shell failed to activate the virtual environment
2022-07-25 01:09:00 【zbossz】
power Shell As soon as you open it, there is a red letter error :
Invoke-Expression : The position of That's ok :1 character : 1164
+ ... \Xshell 7;C:\Program Files (x86)\NetSarang\Xftp 7;"C:\Program Files\N ...
+ ~~~~~~~~~~
An expression or statement contains an unexpected tag “C:\Program”.
The position of D:\Programe\Anaconda\shell\condabin\Conda.psm1:109 character : 15
+ Invoke-Expression -Command $activateCommand;
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ParserError: (:) [Invoke-Expression], ParseException
+ FullyQualifiedErrorId : UnexpectedToken,Microsoft.PowerShell.Commands.InvokeExpressionCommand
I use a lot here It's useless The way to :
①conda init
②conda install -n root -c pscondaenvs pscondaenvs
③ hold Invoke-Expression -Command $activateCommand;
Change to
If(-not [String]::IsNullOrEmpty($activateCommand)) {
Invoke-Expression -Command $activateCommand;
}
Later, when I checked, I found that many of them had a kind of thinking , That is, there is something wrong with the system environment variables ;
So I revised it along this line
So next, we locate the wrong information 
Inside these signs , These content , It is actually a system environment variable path What's in it :


And then we put 
This variable is found :
Then we find that this variable is :
C:\Program Files\NVIDIA GPU ComputingToolkit\CUDA\v11.3\lib\x64;
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin;
C:\ProgramFiles\NVIDIAGPUComputingToolkit\CUDA\v11.3\common\lib\x64;
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin\
Then let's take a look at the file manager 
We found that there was 2 individual cuda, Now that's it ,11.3 This environment variable is wrong again , Let's just put it directly CUDA\11.3 Delete the environment variable of . Just use cuda10.1【 Because many of my deep learning environments are installed torchgpu The version is cu101 Of , So I keep it cu101 Environment variables of 】
That's it after deletion :
You can see cuda Not in the back

This environment variable has been deleted for me , Although the final result is the same as some of the information reported in error , Because I forgot to delete the previous environment variables in the screenshot .
But this error report has been solved for us , There will be no more errors when opening :
I saw many people on the Internet who didn't use my same solution , Maybe it's because they didn't pretend like me 2 Versions CUDA, So there is no conflict . So , If you are a friend of deep learning power shell There is a problem at the beginning , It is likely that there is the same as me cuda Environment variable conflict problem , Just report the error
Delete the environment variables here 【 The premise is that you are also in conflict with multiple versions of environment variables 】
Or is it , You can consider adjusting the position of environment variables .
that , This problem is solved .End of this period , See you next time .
边栏推荐
- [25. Hash table]
- The use of Multimeter in circuit analysis experiment of Shandong University
- On let variable promotion
- Esp32 OLED lvgl displays common Chinese characters
- C language word translation (to help understand the basic meaning of words) is updated from time to time
- Vscode installation and configuration
- Pads copper laying
- Unity3d calls between different script functions or parameters
- Record the bugs encountered and some work experience
- [29. DFS depth is preferred]
猜你喜欢

Game partner topic: the cooperation between breederdao and monkeyleague kicked off

Windows security hardening -- close unnecessary ports

BisinessCardGen

Dpdk based basic knowledge sorting-01

Introduction to thread pool

How to use measurement data to drive the improvement of code review

Vscode installation and configuration

MySQL Basics (concepts, common instructions)

Human cell prosci 4-1BB ligand recombinant protein scheme

Password input box and coupon and custom soft keyboard
随机推荐
ROS manipulator movelt learning notes 3 | kinect360 camera (V1) related configuration
The use of Multimeter in circuit analysis experiment of Shandong University
Join MotoGP Monster Energy British Grand Prix!
Amd epyc 9654 Genoa CPU cache test exposure L1 bandwidth up to 30tb/s
Codeworks round 650 (Div. 3) ABCD solution
Breederdao's first proposal was released: the constitution of the Dao organization
About the difference between for... In and for... Of and object. Keys()
Verification of Kirchhoff's law and Multisim Simulation (engineering documents attached)
Heavy forecast! Analysys, together with Microsoft and the Central University of Finance and economics, talks about the digital economy
Summary of MATLAB basic grammar
Moonpdflib Preview PDF usage record
Windows security hardening -- close unnecessary ports
What is iftmcs indicating contract status message?
Basic functions of tea
paddlepaddle论文系列之Alexnet详解(附源码)
The troubleshooting process of a segment error (disassembly address troubleshooting)
Which bank outlet in Zhejiang can buy REITs fund products?
VC hesitates to invest in Henan
Install scoop and lux (formerly Annie)
How to use measurement data to drive the improvement of code review
