简体   繁体   English

在Visual Studio中运行Python代码 - 安装pip无法正常工作

[英]Running Python code in Visual Studio - installing pip not working

I m trying to connect Linkedin to my Python. and I m trying to connect Linkedin to my Python. and I m trying to connect Linkedin to my Python. and I m trying to run these in Visual Studio m trying to connect Linkedin to my Python. and I试图在Visual Studio中运行它们

For the below line, 对于以下行,

$ pip install python-linkedin $ pip install python-linkedin

it keeps throwing syntax error, not reading that $pip correctly. 它不断抛出语法错误,而不是正确读取$ pip。

I followed few videos and posts on Stackoverflow, and they suggested to click on "View" -> "Tools" -> Python environments, but I can`t find this "Tool" and Python environments from View option 我在Stackoverflow上关注了几个视频和帖子,他们建议点击“查看” - >“工具” - > Python环境,但是我无法从View选项中找到这个“工具”和Python环境

Is there any alternative solutions to this? 这有什么替代解决方案吗?

Screenshot is my Visual Studio setting, if it helps.. VS setup 截图是我的Visual Studio设置,如果它有帮助.. VS设置

You need to install Python support for VS to work with python. 您需要为VS安装Python支持才能使用python。

https://docs.microsoft.com/en-us/visualstudio/python/installing-python-support-in-visual-studio?view=vs-2019 https://docs.microsoft.com/en-us/visualstudio/python/installing-python-support-in-visual-studio?view=vs-2019

Once you do that you should be able to see the python environment tab. 一旦你这样做,你应该能够看到python环境选项卡。 It would look like this: 它看起来像这样: 在此输入图像描述

Another potential issue is that pip for python3.x is usually installed as pip3.x, not pip, so if you are using python 3x, you would need to change your settings.json accordingly. 另一个潜在的问题是python3.x的pip通常安装为pip3.x,而不是pip,所以如果你使用的是python 3x,你需要相应地更改settings.json。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM