conda创建虚拟环境

注意新开终端后要重新启动

1
2
3
4
5
6
7
conda create -n py38 python==3.8  //创建虚拟环境
conda activate py38 //开启虚拟环境
conda deactivate py38 //关闭虚拟环境
conda remove --name py38 --all // 删除虚拟环境

如果只删除虚拟环境中的某个或者某些包则是:
conda remove --name env_name package_name

前面出现

(base)就说明启动成功

报错处理

1757840994583-3b25de31-8c5c-428e-ac62-02199ae1438e.png

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Windows PowerShell
版权所有(C) Microsoft Corporation。保留所有权利。

安装最新的 PowerShell,了解新功能和改进!https://aka.ms/PSWindows

. : 无法加载文件 C:\Users\xxx\Documents\WindowsPowerShell\profile.ps1,因为在此系统上禁止运行脚本。有关详细信息,请
参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 3
+ . 'C:\Users\xxx\Documents\WindowsPowerShell\profile.ps1'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [],PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
PS C:\Users\xxx> conda init powershell
no change I:\anaconda\Scripts\conda.exe
no change I:\anaconda\Scripts\conda-env.exe
no change I:\anaconda\Scripts\conda-script.py
no change I:\anaconda\Scripts\conda-env-script.py
no change I:\anaconda\condabin\conda.bat
no change I:\anaconda\Library\bin\conda.bat
no change I:\anaconda\condabin\_conda_activate.bat
no change I:\anaconda\condabin\rename_tmp.bat
no change I:\anaconda\condabin\conda_auto_activate.bat
no change I:\anaconda\condabin\conda_hook.bat
no change I:\anaconda\Scripts\activate.bat
no change I:\anaconda\condabin\activate.bat
no change I:\anaconda\condabin\deactivate.bat
needs sudo I:\anaconda\Scripts\activate
needs sudo I:\anaconda\Scripts\deactivate
needs sudo I:\anaconda\etc\profile.d\conda.sh
needs sudo I:\anaconda\etc\fish\conf.d\conda.fish
no change I:\anaconda\shell\condabin\Conda.psm1
needs sudo I:\anaconda\shell\condabin\conda-hook.ps1
no change I:\anaconda\Lib\site-packages\xontrib\conda.xsh
needs sudo I:\anaconda\etc\profile.d\conda.csh
no change C:\Users\xxx\Documents\WindowsPowerShell\profile.ps1
No action taken.

如何解决:

打开PowerShell,运行

1
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

例题

nssctf入门pyc

查看是py312magic头

conda create -n py312 python==3.12

conda activate py312

要去对应的py版本下面反汇编才能出现额外pyc

python .\pyinstxtractor.py 1.exe

1757841634727-b1e19a1e-6fb0-47ca-9f27-87dbca0b7356.png

pycdc.exe main.pyc > main.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Source Generated with Decompyle++
# File: main.pyc (Python 3.12)

import extra
user_input = input('plz input flag: ')
res = []
enc = [
52,
41,
41,
57,
46,
60,
1,
10,
3,
25,
37,
19,
9,
37,
10,
3,
14,
18,
21,
20,
37,
24,
3,
14,
31,
25,
21,
30,
31,
7]
for i in user_input:
res.append(extra.cul(ord(i)))
for j in range(len(res)):
if not res[j] != enc[j]:
continue
print('Wrong flag!')
exit()
print('You get flag!')

找到extra.pyc

1757841434048-60b1ab00-4e80-4901-8168-b61bcd74140e.png

1757841657596-aaeb0ef5-45f6-47c3-8153-199b6c354f00.png

1757841714499-d391c22c-bce5-446b-9f33-dcfde71ad850.png

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
enc = [
52,
41,
41,
57,
46,
60,
1,
10,
3,
25,
37,
19,
9,
37,
10,
3,
14,
18,
21,
20,
37,
24,
3,
14,
31,
25,
21,
30,
31,
7]
for i in enc:
print(chr(i^122),end='')

更新: 2025-09-29 14:40:10
原文: https://www.yuque.com/chaye-apqbl/vsc85q/fht6xfvt7cwrnlp3


http://example.com/2026/01/19/RE/各种语言/python反编译/conda创建虚拟环境/
Author
chaye
Posted on
January 19, 2026
Licensed under