小编Kal*_*eab的帖子

pgadmin4:无法联系postgresql应用程序服务器.

我在Windows 8.1上安装了PostgreSQL 9.6.2.但是pgadmin4无法联系本地服务器.我已尝试在stackoverflow中建议的几个解决方案,尝试卸载并重新安装PostgreSQL 9.6.2,尝试修改config.py,config_distro.py,并删除Roaming文件夹中的文件,我尝试了独立的pgadmin4安装,但没有成功.但是,在我的本地机器上,我能够使用psql.exe访问服务器并以超级用户身份登录(postgres用户).你能否建议任何可能的解决方案来启动/运行pgadmin4?谢谢.

postgresql configuration pgadmin-4

83
推荐指数
13
解决办法
13万
查看次数

在Windows上运行Django的'WinError 10013'

我收到这个问题已经快一个月了,非常感谢您的帮助。尝试登录Django Web应用程序时,我在/ accounts / login /遇到OSError。我能够以127.0.0.1:8000/admin登录,但无法在/ accounts / login登录,从而产生错误代码:

OSError at /accounts/login/
[WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions

Request Method: POST
Request URL:    http://127.0.0.1:8000/accounts/login/
Django Version: 1.11.1
Exception Type: OSError
Exception Value:    
[WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions
Exception Location: C:\Python35-32\lib\socket.py in create_connection, line 702
Python Executable:  C:\Python35-32\myvenv_python3\Scripts\python.exe
Python Version: 3.5.2
Python Path:    
['C:\\Users\\Kaleab\\Desktop\\ecomstore',
 'C:\\Python35-32\\lib\\site-packages\\sqlalchemy-1.1.7-py3.5-win32.egg',
 'C:\\Python27', …
Run Code Online (Sandbox Code Playgroud)

python sockets windows django

5
推荐指数
2
解决办法
5276
查看次数

如何使用python查找线段的长度

我想使用 Python 计算(任意数量)线段的长度。我使用了以下代码,但我遇到元组不能作为操作数的减法。我怎样才能克服它?我想知道我是否遗漏了任何重要的 Python 概念。

from itertools import starmap
import math
class Point(object):
    def __init__(self,x,y):
        self.x=x
        self.y=y
    def move(self,dx,dy):
        self.x+=dx
        self.y+=dy


class LineString(object):

    def __init__(self,*args): # A method with any number of arguments, args

        self.args=[Point(*args) for p in args] # A list of Points

    def length(self):
        pairs=zip(self.args, self.args[1:])
        return sum(starmap(distance,pairs))

def distance(p1, p2):
    a = p1.x,p1.y
    b = p2.x,p2.y

    print (math.sqrt((a[0]-b[0])**2-(a[1]-b[1])**2))
    # calculates distance between two given points p1 and p2
    return math.sqrt((a** 2)+ (b** 2))


if __name__ == '__main__': …
Run Code Online (Sandbox Code Playgroud)

python line

5
推荐指数
1
解决办法
4974
查看次数

PermissionError (WinError 31) 连接到系统的设备无法正常工作

我正在尝试通过python get-pip.py命令在我的 python3.6 virtualenv 上安装 pip,但出现错误:

(myvenv_python3) C:\Users\Kaleab\Downloads>python get-pip.py --trusted-host=pypi
.org
Collecting pip
  Downloading https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b
44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl (1.3MB)

Could not install packages due to an EnvironmentError: [WinError 31] A device at
tached to the system is not functioning
Consider using the `--user` option or check the permissions.

Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-
8'>
PermissionError: [WinError 31] A device attached to the system is not functionin
g

(myvenv_python3) C:\Users\Kaleab\Downloads>
Run Code Online (Sandbox Code Playgroud)

你会推荐什么解决方案?我正在使用 Windows 8.1 机器。

python pip windows-8.1

3
推荐指数
1
解决办法
4917
查看次数