Port number was not a decimal number between 0 and 65535

在使用端口号时,确实需要确保端口号是一个介于0到65535之间的十进制数字。端口号用于在网络通信中标识特定的服务或应用程序。例如,HTTP服务通常使用端口80,HTTPS服务通常使用端口443。

如果你遇到了“端口号不是一个十进制数,或者不在0到65535的范围内”的错误,这通常是因为你在配置网络服务、编写代码或使用某些网络工具时输入了错误的端口号。以下是一些解决此问题的步骤:

检查端口号的格式:

确保你输入的是纯数字,例如“8080”而不是“8080px”或“8080 端口”。

验证范围:

确保端口号在0到65535之间。例如,常见的Web服务器端口有80和443,而一些常用的非标准端口如数据库端口可能是3306(MySQL),27017(MongoDB)等。

使用正确的数据类型:

如果你在编程中指定端口号,确保它被正确地声明为整数类型。例如,在Python中,你应该这样写:

port = 8080 # 确保这是一个整数

检查配置文件:

如果你在配置文件(如Apache、Nginx配置文件或应用程序的配置文件)中设置端口号,确保格式正确。例如,在Nginx中设置监听端口:

server {
listen 8080;

}

使用网络工具和命令:

当使用命令行工具(如netstat, telnet, nc等)时,确保你输入的端口号正确。例如,使用telnet命令检查端口是否开放:

telnet example.com 8080

检查编程环境:

如果你在开发环境中遇到这个问题,检查你的开发环境或IDE(如Visual Studio Code, PyCharm等)的设置是否允许你输入有效的端口号。

通过以上步骤,你应该能够解决因端口号格式或范围错误导致的问题。如果问题仍然存在,请仔细检查你的代码或配置文件中的其他相关设置,确保没有其他配置错误导致的问题。

Traceback (most recent call last): File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\curl_cffi\requests\session.py", line 600, in request c.perform() File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\curl_cffi\curl.py", line 329, in perform self._check_error(ret, "perform") File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\curl_cffi\curl.py", line 154, in _check_error raise error curl_cffi.curl.CurlError: Failed to perform, curl: (5) Unsupported proxy syntax in 'socks5://prem.us.iprocket.io:9595@com64372217-res-ROW:Qn9yLxkLewv9uTg': Port number was not a decimal number between 0 and 65535. See https://curl.se/libcurl/c/libcurl-errors.html first for more details. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\Admin\Desktop\PPL\all_.py", line 341, in <module> login_before,cookies = get_first_requests(datadome) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\Desktop\PPL\all_.py", line 40, in get_first_requests response = requests.get(url, headers=headers, cookies=cookies,proxies=proxy) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\curl_cffi\requests\__init__.py", line 142, in get return request(method="GET", url=url, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\curl_cffi\requests\__init__.py", line 134, in request return s.request(method=method, url=url, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\curl_cffi\requests\session.py", line 605, in request raise error(str(e), e.code, rsp) from e curl_cffi.requests.exceptions.ProxyError: Failed to perform, curl: (5) Unsupported proxy syntax in 'socks5://prem.us.iprocket.io:9595@com64372217-res-ROW:Qn9yLxkLewv9uTg': Port number was not a decimal number between 0 and 65535. See https://curl.se/libcurl/c/libcurl-errors.html first for more details.
最新发布
07-30
D:\s\envs\pytorch8\python.exe D:\yolov5-7.0\detect.py detect: weights=yolov5s.pt, source=data\images, data=data\coco128.yaml, imgsz=[640, 640], conf_thres=0.25, iou_thres=0.45, max_det=1000, device=, view_img=False, save_txt=False, save_conf=False, save_crop=False, nosave=False, classes=None, agnostic_nms=False, augment=False, visualize=False, update=False, project=runs\detect, name=exp, exist_ok=False, line_thickness=3, hide_labels=False, hide_conf=False, half=False, dnn=False, vid_stride=1 YOLOv5 2025-5-24 Python-3.12.9 torch-2.5.1 CUDA:0 (NVIDIA GeForce RTX 4060 Laptop GPU, 8188MiB) Downloading https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5s.pt to yolov5s.pt... ERROR: <urlopen error [WinError 10060] > Re-attempting https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5s.pt to yolov5s.pt... curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535 ERROR: Downloaded file 'yolov5s.pt' does not exist or size is < min_bytes=100000.0 yolov5s.pt missing, try downloading from https://github.com/ultralytics/yolov5/releases/v7.0 or https://drive.google.com/drive/folders/1EFQTEUeXWSFww0luse2jB9M1QNZQGwNl D:\yolov5-7.0\models\experimental.py:79: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature. ckpt = torch.load(attempt_download(w), map_location='cpu') # load Traceback (most recent call last): File "D:\yolov5-7.0\detect.py", line 259, in <module> main(opt) File "D:\yolov5-7.0\detect.py", line 254, in main run(**vars(opt)) File "D:\s\envs\pytorch8\Lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "D:\yolov5-7.0\detect.py", line 96, in run model = DetectMultiBackend(weights, device=device, dnn=dnn, data=data, fp16=half) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\yolov5-7.0\models\common.py", line 345, in __init__ model = attempt_load(weights if isinstance(weights, list) else w, device=device, inplace=True, fuse=fuse) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\yolov5-7.0\models\experimental.py", line 79, in attempt_load ckpt = torch.load(attempt_download(w), map_location='cpu') # load ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\s\envs\pytorch8\Lib\site-packages\torch\serialization.py", line 1319, in load with _open_file_like(f, "rb") as opened_file: ^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\s\envs\pytorch8\Lib\site-packages\torch\serialization.py", line 659, in _open_file_like return _open_file(name_or_buffer, mode) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\s\envs\pytorch8\Lib\site-packages\torch\serialization.py", line 640, in __init__ super().__init__(open(name, mode)) ^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'yolov5s.pt' 进程已结束,退出代码为 1
05-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

计算机辅助工程

感谢鼓励!

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

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

打赏作者

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

抵扣说明:

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

余额充值