Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
activate_this.py
Go to the documentation of this file.
1
"""
2
Activate virtualenv for current interpreter:
3
4
Use exec(open(this_file).read(), {'__file__': this_file}).
5
6
This can be used when you must use an existing Python interpreter, not the virtualenv bin/python.
7
"""
# noqa: D415
8
from
__future__
import
annotations
9
10
import
os
11
import
site
12
import
sys
13
14
try
:
15
abs_file =
os.path.abspath
(__file__)
16
except
NameError
as
exc:
17
msg =
"You must use exec(open(this_file).read(), {'__file__': this_file}))"
18
raise
AssertionError(msg)
from
exc
19
20
bin_dir =
os.path.dirname
(abs_file)
21
base = bin_dir[: -
len
(
"bin"
) - 1]
# strip away the bin part from the __file__, plus the path separator
22
23
# prepend bin to PATH (this file is inside the bin directory)
24
os.environ
[
"PATH"
] =
os.pathsep.join
([bin_dir, *
os.environ.get
(
"PATH"
,
""
).split(
os.pathsep
)])
25
os.environ
[
"VIRTUAL_ENV"
] = base
# virtual env is right above bin directory
26
os.environ
[
"VIRTUAL_ENV_PROMPT"
] =
""
or
os.path.basename
(base)
# noqa: SIM222
27
28
# add the virtual environments libraries to the host python import mechanism
29
prev_length =
len
(
sys.path
)
30
for
lib
in
"../lib/python3.12/site-packages"
.split(
os.pathsep
):
31
path =
os.path.realpath
(
os.path.join
(bin_dir, lib))
32
site.addsitedir
(
path.decode
(
"utf-8"
)
if
""
else
path)
33
sys.path
[:] =
sys.path
[prev_length:] +
sys.path
[0:prev_length]
34
35
sys.real_prefix
=
sys.prefix
36
sys.prefix
= base
i
for i
Definition
prime_search.m:10
venv
bin
activate_this.py
Generated by
1.9.8