AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-5451

mulllhausen's questions

Martin Hope
mulllhausen
Asked: 2024-04-07 10:21:14 +0800 CST

无法从 debian 11 卸载 virtualenv

  • 7

我的 debian 操作系统已经进行了几次升级,现在版本为 11 (Bullseye)。我最初是从 开始的python2,现在我不再想要它了——我只是想要python3。我virtualenv很久以前就安装了,当时我还在使用python2.

我已经做了完整的dist-upgrade:

$ sudo apt-get update
Hit:1 http://deb.debian.org/debian bullseye InRelease
Get:2 https://deb.nodesource.com/node_14.x bullseye InRelease [4,586 B]
Get:3 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]
Hit:4 http://deb.debian.org/debian bullseye-updates InRelease
Fetched 53.0 kB in 1s (49.9 kB/s)
Reading package lists... Done
$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  libts-dev
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

当我检查是否virtualenv已安装时,它说是:

$ which virtualenv
/usr/local/bin/virtualenv

我尝试卸载它,但pip告诉我它没有安装:

$ pip uninstall virtualenv
WARNING: Skipping virtualenv as it is not installed
$ sudo pip uninstall virtualenv
WARNING: Skipping virtualenv as it is not installed.
$ pip3 uninstall virtualenv
WARNING: Skipping virtualenv as it is not installed
$ sudo pip3 uninstall virtualenv
WARNING: Skipping virtualenv as it is not installed.

我还尝试使用包管理器卸载,以防它是这样安装的

$ sudo apt-get remove virtualenv --purge
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'virtualenv' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

但毕竟我仍然可以看到它已安装:

$ which virtualenv
/usr/local/bin/virtualenv

我想删除它的原因是当我尝试运行它时它出现错误。我正在考虑完全删除它并再次安装将解决此问题:

$ virtualenv .
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 7, in <module>
    from virtualenv import main
ModuleNotFoundError: No module named 'virtualenv'

我应该删除吗/usr/local/bin/virtualenv?这似乎是个坏主意。如何virtualenv使用包管理器删除?

更新 1 - 尝试virtualenv使用安装pip3

安装成功但virtualenv仍然无法运行,没有报错:

$ pip3 install virtualenv
Defaulting to user installation because normal site-packages is not writeable
Collecting virtualenv
  Using cached virtualenv-20.25.1-py3-none-any.whl.metadata (4.4 kB)
Requirement already satisfied: distlib<1,>=0.3.7 in ./.local/lib/python3.9/site-packages (from virtualenv) (0.3.8)
Requirement already satisfied: filelock<4,>=3.12.2 in ./.local/lib/python3.9/site-packages (from virtualenv) (3.13.3)
Requirement already satisfied: platformdirs<5,>=3.9.1 in ./.local/lib/python3.9/site-packages (from virtualenv) (4.2.0)
Using cached virtualenv-20.25.1-py3-none-any.whl (3.8 MB)
Installing collected packages: virtualenv
  WARNING: The script virtualenv is installed in '/home/me/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed virtualenv-20.25.1
$ which virtualenv
/usr/local/bin/virtualenv
$ virtualenv --version
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 7, in <module>
    from virtualenv import main
ImportError: cannot import name 'main' from 'virtualenv' (/home/me/.local/lib/python3.9/site-packages/virtualenv/__init__.py)
$ virtualenv .
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 7, in <module>
    from virtualenv import main
ImportError: cannot import name 'main' from 'virtualenv' (/home/me/.local/lib/python3.9/site-packages/virtualenv/__init__.py)

现在virtualenv存在于文件系统上的两个位置:

$ which virtualenv
/usr/local/bin/virtualenv
$ sudo find /usr/ -iname "virtualenv" | grep bin
/usr/local/bin/virtualenv
$ sudo find /home/me/.local/ -iname "virtualenv" | grep bin
/home/me/.local/bin/virtualenv
$ ls -l /home/me/.local/bin/virtualenv 
-rwxr-xr-x 1 me me 238 Apr  7 13:06 /home/me/.local/bin/virtualenv
debian
  • 1 个回答
  • 88 Views
Martin Hope
mulllhausen
Asked: 2021-10-22 06:40:14 +0800 CST

强制 apt-get 安装更高版本的 nodejs

  • 0

我在 Debian 11 上,完全是最新的 ( apt-get update && apt-get upgrade && apt-get dist-upgrade)。我之前安装了nodejs12.22 版本,因为那是 Debian 存储库中的内容,如下所示:

$ sudo apt-get install nodejs
$ node -v
v12.22.5

但是我想使用 v14.18。我删除了节点版本 12 的所有痕迹,如下所示:

$ sudo apt-get remove --purge nodejs

然后使用https://github.com/nodesource/distributions添加 nodejs 的 PPA :

$ curl -fsSL https://deb.nodesource.com/setup_lts.x -o nodesource_setup_14_lts.sh
$ sudo bash nodesource_setup_14_lts.sh

我可以看到它在下面添加了新的 PPA /etc/apt/sources.list.d/:

$ cat /etc/apt/sources.list.d/nodesource.list 
deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x bullseye main
deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x bullseye main
$ sudo apt-get update
Hit:1 http://httpredir.debian.org/debian bullseye InRelease
Hit:2 http://httpredir.debian.org/debian-security bullseye-security InRelease
Hit:3 http://httpredir.debian.org/debian bullseye-updates InRelease
Hit:4 https://deb.nodesource.com/node_14.x bullseye InRelease
Reading package lists... Done

但是现在当我去安装nodejs它仍然使用版本 12 :(

$ sudo apt-get install nodejs --dry-run
The following NEW packages will be installed:
  nodejs
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Inst nodejs (12.22.5~dfsg-2~11u1 Debian:11.1/stable, Debian-Security:11/stable-security [i386])
Conf nodejs (12.22.5~dfsg-2~11u1 Debian:11.1/stable, Debian-Security:11/stable-security [i386])

似乎apt-get没有使用新的 PPA 来决定nodejs要安装的版本。如何在系统范围内安装 v14.18?

编辑

请注意,我使用的是 32 位机器:

$ uname -m
i686

当我在我的另一台 64 位机器上执行上述过程时,它工作正常,并且从 PPA 安装了 14.18 版本。

额外要求的信息:

$ apt-cache policy nodejs
nodejs:
  Installed: (none)
  Candidate: 12.22.5~dfsg-2~11u1
  Version table:
     12.22.5~dfsg-2~11u1 500
        500 http://httpredir.debian.org/debian bullseye/main i386 Packages
        500 http://httpredir.debian.org/debian-security bullseye-security/main i386 Packages
debian apt
  • 1 个回答
  • 245 Views
Martin Hope
mulllhausen
Asked: 2018-10-07 17:53:34 +0800 CST

在双显示器上校准触摸屏(一触一非)

  • 7

我正在使用 Debian 9。我有一台带有 2 个内置显示器的小型 PC,打算用作销售点。它有一台面向客户的显示器(非触摸屏)和一台面向收银员的显示器(触摸屏)。每台显示器的分辨率为 1366 x 768。我有一个作为唯一 x 客户端运行的 POS 应用程序 - 不存在窗口管理器和桌面管理器。这样系统消耗最少的资源。即我可以像这样从终端运行它:

xinit my-pos-app $* -- :1

只要我使用鼠标,应用程序就可以正常运行。然而,目的是让这项工作仅使用触摸屏。

问题是触摸屏没有校准。我可以看到,当我触摸它时,我触摸的右侧约 10 厘米处的一个点实际上被激活了。所以我尝试使用xinput_calibrator- 一个程序,它会在屏幕上显示一个 gui 点来触摸并自动校准触摸屏。但是按照目前的设置,完成这一步是不可能的。这是因为只有一台显示器是触摸屏,而另一台显示器不是,但xinput_calibrator没有意识到这一点,它将一半的图片放在每台显示器上。非触摸屏显示器上的校准点显然无法触摸,因此我无法完成该xinput_calibrator过程。

当我将鼠标移动到第一台显示器的右侧时,我注意到它出现在第二台显示器的左侧。因此,系统似乎将两台显示器并排放置。我对这种低级显示器配置的东西了解不多,但是从 的输出来看xrandr,系统似乎认为它只有 1 个显示器:

$ xrandr
Screen 0: minimum 320 x 200, current 2732 x 768, maximum 8192 x 8192
eDP-1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 344mm
x 193mm
1366x768  60.00*+  40.00
1360x768  59.80    59.96
1024x768  60.04    60.00
960x720   60.00
928x696   60.05
896x672   60.01
960x600   60.00
960x540   59.99
800x600   60.00    60.32    56.25
840x525   60.01    59.88
800x512   60.17
700x525   59.98
640x512   60.02
720x450   59.89
640x480   60.00    59.94
680x384   59.80    59.96
576x432   60.06
512x384   60.00
400x300   60.32    56.34
320x240   60.05
VGA-1 disconnected (normal left inverted right x axis y axis)
DP-1 connected 1366x768+1366+0 (normal left inverted right x axis y axis) 344mm x 194mm
1366x768  60.00*+  40.00
HDMI-1 disconnected (normal left inverted right x axis y axis)

此外,xinput显示触摸屏的设备 ID 是12.

请有人告诉我如何正确配置触摸屏。我需要先使用 xrandr 将屏幕一分为二吗?如果是这样,那我该怎么做?我被困住了。

x11 xrandr
  • 1 个回答
  • 6606 Views
Martin Hope
mulllhausen
Asked: 2017-12-05 03:40:54 +0800 CST

带有 apache2 配置路径错误的 SVN

  • 0

我刚刚svn通过 https (with apache2) 进行了配置。我可以svn checkout,但是提交失败了。我可以从apache2日志中看到,svn服务器正在错误的位置查找用于执行提交的存储库。这是我的apache2443.example.com.conf 文件:

<IfModule mod_ssl.c>
    <virtualhost *:443>
    # requests to https://example.com land here
    ServerName example.com
    DocumentRoot /home/me/svn-repos

    # global properties for all directories in this site
    <Location />
        # do not use .htaccess files
        allowoverride none
        #DirectoryIndex index.html
        #require all granted                                                                                    

        DAV svn
        SVNParentPath /home/me/svn-repos
        AuthType Basic
        AuthName "svn repositories"
        AuthUserFile blah.passwd
        #<LimitExcept GET PROPFIND OPTIONS REPORT>
        Require valid-user
        #</LimitExcept>
    </Location>

    SSLEngine On
    SSLCertificateFile blah
    SSLCertificateKeyFile blah

    <FilesMatch "\.(cgi|shtml|phtml|php)$">
            SSLOptions +StdEnvVars
    </FilesMatch>

    ErrorDocument 400 /index.html
    ErrorDocument 401 /index.html
    # lots more ErrorDocument entries

    </virtualhost>
</IfModule>

请注意,我所有的svn存储库都在/home/me/svn-repos(例如/home/me/svn-repos/repo1,,/home/me/svn-repos/repo2等)下的目录中

因此,我查看了我的一个存储库的新本地副本:

$ cd /tmp
$ svn co --username me https://example.com/repo1 repo1
Authentication realm: <https://example.com:443> svn repositories
Password for 'me': ***

A repo1/file1.txt
Checked out revision 1.

到目前为止,一切都很好。但是当我尝试提交时:

$ touch file2.txt
$ svn add file2.txt
A     file2.txt
$ svn ci file2.txt -m added
Authentication realm: <https://example.com:443> svn repositories
Password for 'me': ***

Adding         file2.txt
svn: E175009: Commit failed (details follow):
svn: E175009: The XML response contains invalid XML
svn: E130003: Malformed XML: no element found

我可以从apache2错误日志中看到svn服务器在错误的位置寻找存储库:

$ sudo tail -4 /var/log/apache2/error.log
[Sat Dec 02 20:23:29.626227 2017] [:error] [pid 123] (20014)Internal error (specific information not available): [client x.x.x.x:x] Can't open file '/home/me/svn-repos/index.html/format': Not a directory
[Sat Dec 02 20:23:29.626264 2017] [dav:error] [pid 123] [client x.x.x.x:x] Could not fetch resource information.  [404, #0]
[Sat Dec 02 20:23:29.626272 2017] [dav:error] [pid 123] [client x.x.x.x:x] Could not find the requested SVN filesystem  [404, #20]
[Sat Dec 02 20:23:29.626277 2017] [dav:error] [pid 123] [client x.x.x.x:x] Could not find the requested SVN filesystem  [404, #20]

它正在寻找的文件是/home/me/svn-repos/repo1/format,但是它没有附加正确的路径才能找到该文件。我怀疑这意味着我需要在我的apache2443.example.com.conf 文件中放一些东西,但我想不出是什么。

更新

我对 443.example.com.conf 文件进行了以下更改:

# ErrorDocument 404 /index.html
ErrorDocument 404 /indexyz.html

现在,当我尝试提交时,错误消息变为:

[Sat Dec 02 20:39:00.153942 2017] [:error] [pid 123] (20014)Internal error (specific information not available): [client 192.168.1.177:50228] Can't open file '/home/me/svn-repos/indexyz.html/format': No such file or directory
[Sat Dec 02 20:39:00.153979 2017] [dav:error] [pid 123] [client x.x.x.x:x] Could not fetch resource information.  [404, #0]
[Sat Dec 02 20:39:00.153987 2017] [dav:error] [pid 123] [client x.x.x.x:x] Could not find the requested SVN filesystem  [404, #2]
[Sat Dec 02 20:39:00.153992 2017] [dav:error] [pid 123] [client x.x.x.x:x] Could not find the requested SVN filesystem  [404, #2]

但这仍然没有多大帮助。

apache-httpd subversion
  • 2 个回答
  • 1588 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve