Skip to content

Commit

Permalink
fix ubuntu 22.04 env bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mjq2020 committed Nov 28, 2022
1 parent 80f3fac commit ae0d8ac
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion tools/env_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def install_pyncnn():

# install
os.chdir(ncnn_dir)
command(f'cd python && {pip} install -e .' + pip_mirror)
command(f'cd python && {pip} install ncnn' + pip_mirror)

path_ls = []
path_ls.append(osp.join(ncnn_dir, 'build', 'tools', 'onnx'))
Expand Down
30 changes: 15 additions & 15 deletions tools/ubuntu_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def ensure_base_env(work_dir, dep_dir):

#dep
os.system(
f"{sudo} apt-get install cmake curl wget git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev -y"
f"{sudo} apt-get install cmake curl wget git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev python3-dev -y"
)

# check ubuntu
Expand Down Expand Up @@ -155,20 +155,20 @@ def ensure_base_env(work_dir, dep_dir):
# check torch and mmcv, we try to install mmcv, it is not compulsory
mmcv_version = None
torch_version = None
try:
import torch
torch_version = torch.__version__

try:
import mmcv
mmcv_version = mmcv.__version__
except Exception:
# install mmcv
print('mmcv not found, try install mmcv ..', end='')
os.system('python3 -m pip install -U openmim')
os.system('mim install mmcv-full==1.5.1')
except Exception:
pass
# try:
# import torch
# torch_version = torch.__version__

# try:
# import mmcv
# mmcv_version = mmcv.__version__
# except Exception:
# # install mmcv
# print('mmcv not found, try install mmcv ..', end='')
# os.system('python3 -m pip install -U openmim')
# os.system('mim install mmcv-full==1.5.1')
# except Exception:
# pass

# git
git = simple_check_install('git', sudo)
Expand Down

0 comments on commit ae0d8ac

Please sign in to comment.