Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/305.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在使用pip安装Python模块后,如何启动该模块的主要功能?_Python_Python 3.x_Pip - Fatal编程技术网

在使用pip安装Python模块后,如何启动该模块的主要功能?

在使用pip安装Python模块后,如何启动该模块的主要功能?,python,python-3.x,pip,Python,Python 3.x,Pip,我有一个Python 3。我正在本地开发它 我试图通过cding将其安装到项目目录中,然后执行 pip3 install . 结果是: Processing /Users/XXXXX/dev/misc/rec2sqlite Building wheels for collected packages: rec2sqlite Building wheel for rec2sqlite (setup.py) ... done Created wheel for rec2sqlite: fi

我有一个Python 3。我正在本地开发它

我试图通过
cd
ing将其安装到项目目录中,然后执行

pip3 install .
结果是:

Processing /Users/XXXXX/dev/misc/rec2sqlite
Building wheels for collected packages: rec2sqlite
  Building wheel for rec2sqlite (setup.py) ... done
  Created wheel for rec2sqlite: filename=rec2sqlite-1.0-py3-none-any.whl size=3758 sha256=77225f8b2444fb4143ffb2aa70ee22735eff591452ba777387cc10b42f21b6ac
  Stored in directory: /private/var/folders/pt/7nsl9k8d6q56bwj9nc6lydzh0000gn/T/pip-ephem-wheel-cache-_voecun1/wheels/8b/47/6c/df4c285c608c63e5b3d6df78ec193cf038b3d4a56f4e3b2420
Successfully built rec2sqlite
Installing collected packages: rec2sqlite
  Attempting uninstall: rec2sqlite
    Found existing installation: rec2sqlite 1.0
    Uninstalling rec2sqlite-1.0:
      Successfully uninstalled rec2sqlite-1.0
Successfully installed rec2sqlite-1.0
然后我转到另一个目录,想运行main函数。我输入了
python3 rec2sqlite
,得到了以下输出:

/usr/local/bin/python3: can't open file 'rec2sqlite': [Errno 2] No such file or directory

在使用
pip
安装当前版本后,为了能够运行,我需要对源代码和/或使用的命令进行哪些更改?

从项目目录中运行
python3 rec2sqlite
时会发生什么? 如果您必须从另一个目录运行它,您可以尝试使用python3//rec2sqlite目录的完整路径。要修复错误,我必须执行以下操作:

  • 将主功能代码放入文件
    \uuuu main\uuuuu.py
  • 使用项目目录中的
    pip3 Install.
    安装程序包
  • 使用
    python3-m
    (例如
    python3-m rec2sqlite
    )运行步骤2中安装的程序

  • 这不是使用pip安装模块的重点。当我安装带有pip的模块时,我希望它可以在任何目录下工作。