报错信息:

无法加载文件 C:\Users\April\Documents\WindowsPowerShell\profile.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:

/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。

所在位置 行:1 字符: 3

+ . 'C:\Users\April\Documents\WindowsPowerShell\profile.ps1'

+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : SecurityError: (:) [],PSSecurityException

    + FullyQualifiedErrorId : UnauthorizedAccess

PS C:\Users\用户名\PycharmProjects\pythonProject> C:/ProgramData/anaconda3/Scripts/activate

PS C:\Users\用户名\PycharmProjects\pythonProject> conda activate crrg

CondaError: Run 'conda init' before 'conda activate'

原因:Windows 默认禁止运行任何脚本(包括 Conda 自动生成的 profile.ps1

解决:管理员身份运行powershell,输入:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Logo

欢迎加入DeepSeek 技术社区。在这里,你可以找到志同道合的朋友,共同探索AI技术的奥秘。

更多推荐