windows10搭建maxkb开发环境(劝退指南)

windows搭建maxkb开发环境踩坑记录,先说结论吧,windows上面搞不下去了,直接在ubuntu等linux环境搭建吧,别浪费时间了。

1.maxKB开发环境搭建

官方文档:https://maxkb.cn/docs/dev_manual/dev_environment/

2.各种坑

2.1 files.pythonhosted.org

错误:

ReadTimeoutError: HTTPSConnectionPool(host=
‘files.pythonhosted.org’, port=443): Read timed out.

解决:
参考我的博客:https://blog.csdn.net/taotao_guiwang/article/details/140930022
在这里插入图片描述

2.2 Error: pg_config executable not found

解决:首先安装postgreSQL,然后把postgreSQL安装路径,比如“C:\Program Files\PostgreSQL\16\bin”配置到环境变量。
在这里插入图片描述

2.3 utf-8‘ codec can‘t decode byte 0xd3 in position

解决:参考我的博客:https://blog.csdn.net/taotao_guiwang/article/details/140961147
在这里插入图片描述

2.4 loading psycopg2 or psycopg module

错误:在执行“python main.py start”时,报这个错误“raise ImproperlyConfigured(“Error loading psycopg2 or psycopg module”)”。

解决:

pip install psycopg2

2.5 utf-8’ codec can’t decode byte 0xd6

在执行“python main.py start”时,报这个错误:

conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd6 in position 61: invalid continuation byte

解决:
修改数据库账号、密码都是正确的就好了。

2.6 “vector” is not available“

原因:pgsql没有配置vector插件。
解决:

下载vector:https://pgxn.org/dist/vector/0.5.1/
放在:C:\Program Files\PostgreSQL\vector-0.5.1

安装Visual Studio 2022:
下载:https://visualstudio.microsoft.com/zh-hans/downloads/
默认安装路径:
C:\Program Files\Microsoft Visual Studio\2022\Community

打开cmd右键以管理员权限运行,依次输入以下命令:
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
cd C:\Program Files\PostgreSQL\vector-0.5.1
set "PGROOT=C:\Program Files\PostgreSQL\16"
nmake /F Makefile.win
nmake /F Makefile.win install

在这里插入图片描述

2.7 No module named ‘fcntl’

在执行“python main.py start”时,报这个错误:“No module named ‘fcntl’”。

解决:
新建“fcntl.py”,放在“D:\workspace_all\pyCharm\MaxKB-main\venv\Lib\site-packages”,其中fcntl.py内容,如下:

def fcntl(fd, op, arg=0):
    return 0
        
def ioctl(fd, op, arg=0, mutable_flag=True):
    if mutable_flag:
        return 0
    else:
        return ""
    
def flock(fd, op):
    return
        
def lockf(fd, operation, length=0, start=0, whence=0):
    return

2.8 No module named ‘pwd’

在执行“python main.py start”时,报这个错误“ModuleNotFoundError: No module named ‘pwd’”。

解决:不用解决了。这个pwd是linux系统才有的。换Linux吧。
在这里插入图片描述

  • 17
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

core321

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值