继续尝试修复环境变量问题
This commit is contained in:
@@ -40,9 +40,18 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 8,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"工作目录: t:\\jupyter\\notebook\\quantitative_data\n",
|
||||
"Python 版本: 3.10.2 (heads/master:d9999f5, Dec 16 2022, 16:20:32) [MSC v.1929 64 bit (AMD64)]\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import sys\n",
|
||||
"import os\n",
|
||||
@@ -53,12 +62,33 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 9,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"pandas 1.5.0\n",
|
||||
"python-dotenv 1.2.2\n",
|
||||
"SQLAlchemy 1.3.24\n",
|
||||
"tushare 1.2.89\n",
|
||||
"vnpy-tushare 1.2.85.1\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\n",
|
||||
"[notice] A new release of pip available: 22.2.2 -> 26.2\n",
|
||||
"[notice] To update, run: python.exe -m pip install --upgrade pip\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# 检查依赖包\n",
|
||||
"!pip list | findstr -i \"tushare pandas psycopg2 sqlalchemy\""
|
||||
"!pip list | findstr -i \"tushare pandas psycopg2-binary sqlalchemy python-dotenv\""
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -68,14 +98,22 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# 如果需要安装依赖,取消注释下面这行\n",
|
||||
"# !pip install -r requirements.txt"
|
||||
"#!pip install -r requirements.txt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 10,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"模块导入成功!\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# 导入核心模块\n",
|
||||
"from importer import (\n",
|
||||
@@ -105,9 +143,22 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 11,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"✗ 连接失败: connection to server at \"192.168.27.11\", port 5438 failed: fe_sendauth: no password supplied\n",
|
||||
"\n",
|
||||
"请检查:\n",
|
||||
" 1. Docker 容器是否已启动: docker ps | findstr postgres\n",
|
||||
" 2. 环境变量 (.env) 中的连接参数是否正确\n",
|
||||
" 3. 防火墙是否开放 5438 端口\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# 测试数据库连接\n",
|
||||
"try:\n",
|
||||
@@ -625,7 +676,7 @@
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
@@ -639,7 +690,7 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.11.6"
|
||||
"version": "3.10.2"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
||||
Reference in New Issue
Block a user