小编n0n*_*vme的帖子

InstaPy:“错误,无法确定 64 位 linux 的正确文件名”

任何人都知道如何解决这个问题?来自控制台的堆栈跟踪,执行后报告错误:

    InstaPy Version: 0.6.9
    ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._. 
    Workspace in use: "/home/zanettra/InstaPy"
    Error, unable to determine correct filename for 64bit linux
    Traceback (most recent call last):
    File "unfollow.py", line 24, in <module>
    headless_browser=False)
    File "/usr/local/lib/python3.6/dist-packages/instapy/instapy.py", line 
    322, in __init__
    self.logger,
      File "/usr/local/lib/python3.6/dist-packages/instapy/browser.py", line 114, in set_selenium_local_session
        driver_path = geckodriver_path or get_geckodriver()
      File "/usr/local/lib/python3.6/dist-packages/instapy/browser.py", line 36, in get_geckodriver
        sym_path = gdd.download_and_install()[1]
      File "/usr/local/lib/python3.6/dist-packages/webdriverdownloader/webdriverdownloader.py", line 177, in download_and_install
        show_progress_bar=show_progress_bar)
      File "/usr/local/lib/python3.6/dist-packages/webdriverdownloader/webdriverdownloader.py", line 129, in download
        download_url = …
Run Code Online (Sandbox Code Playgroud)

python linux instapy

11
推荐指数
1
解决办法
6926
查看次数

Docker 拒绝在我的 localhost:3000 端口上工作

这是我的 docker-compose.yml 我试图在我的本地项目上运行 cypress,但它拒绝在端口上运行。我做错了什么?

version: '3.2'
   
# run Cypress tests and exit with command
#   docker-compose up --exit-code-from cypress
services:
  cypress:
    # the Docker image to use from https://github.com/cypress-io/cypress-docker-images
    image: "cypress/included:5.0.0"
    environment:
      - CYPRESS_baseUrl=http://localhost:3000
    # share the current folder as volume to avoid copying
    working_dir: /e2e
     command: "--browser chrome"
     ports:
     - 3333:3000
     volumes:
       - ./:/e2e
Run Code Online (Sandbox Code Playgroud)

compose-docker 的结果:

cypress_1  | 
cypress_1  | Cypress automatically waits until your server is accessible before running tests.
cypress_1  | 
cypress_1  | We will try connecting …
Run Code Online (Sandbox Code Playgroud)

docker docker-compose cypress

7
推荐指数
1
解决办法
1823
查看次数

Visual Studio Code 和 Django:导入用户模型时出错

编辑:仍然有这个问题。

Visual Studio Code 抛出以下错误:

User model imported from django.contrib.models

该错误出现在以下脚本 ( models.py) 的第 2 行中。该代码来自 Django 教程,运行良好。但令人烦恼的是 Visual Studio Code ( Pylint ) 会抛出错误(并将脚本标记为红色)。

from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone

# Create your models here.


class Post(models.Model):
    title = models.CharField(max_length=100)
    content = models.TextField()
    date_posted = models.DateTimeField(default=timezone.now)
    author = models.ForeignKey(User, on_delete=models.CASCADE)

    def __str__(self):
        return self.title
Run Code Online (Sandbox Code Playgroud)

此外,VSC 在导入自定义模型时会引发错误,例如Post.

from app_blog.models import Post

错误:无法导入“app_blog.models”

我的设置:

  • WIN10
  • 虚拟环境(Python、Django、Pylint...)
  • 姜戈3.1.1
  • Python 3.8.5
  • 皮林特·姜戈 …

django pylint django-models visual-studio-code

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