小编god*_*har的帖子

模块“virtualenv.create.via_global_ref.builtin.cpython.mac_os”没有属性“CPython2macOsArmFramework”

我正在尝试将 python 包安装到BigSur macos 上的venvusing poetry- 上。

\n

我有稳定的 pyenv python

\n
pyenv which python\n/Users/josh/.pyenv/versions/3.8.6/bin/python\n
Run Code Online (Sandbox Code Playgroud)\n

当我执行时。

\n
\n

诗歌外壳 && 诗歌安装

\n
\n

我收到此错误,但不知道该怎么办。

\n
  AttributeError\n\n  module 'virtualenv.create.via_global_ref.builtin.cpython.mac_os' has no attribute \n'CPython2macOsArmFramework'\n\n  at ~/.pyenv/versions/3.8.2/lib/python3.8/importlib/metadata.py:79 in load\n       75\xe2\x94\x82         """\n       76\xe2\x94\x82         match = self.pattern.match(self.value)\n       77\xe2\x94\x82         module = import_module(match.group('module'))\n       78\xe2\x94\x82         attrs = filter(None, (match.group('attr') or '').split('.'))\n       79\xe2\x94\x82         return functools.reduce(getattr, attrs, module)\n       80\xe2\x94\x82 \n       81\xe2\x94\x82     @property\n       82\xe2\x94\x82     def extras(self):\n       83\xe2\x94\x82         match = self.pattern.match(self.value)\n
Run Code Online (Sandbox Code Playgroud)\n

欢迎任何解决问题的想法!

\n

pyenv python-poetry macos-big-sur

17
推荐指数
4
解决办法
2万
查看次数

节点服务器正在运行但localhost拒绝连接

尝试让最简单的节点服务器与浏览器交互,使用:

var http = require('http');


http.createServer(function(req, res){

  res.writeHead( 200, { "content-Type" : 'text/plain' } )
  res.send('Hello world');

}).listen(1337, '192.168.1.2');
Run Code Online (Sandbox Code Playgroud)

但是localhost不会这样做..

localhost refused to connect
Run Code Online (Sandbox Code Playgroud)

那是IPv4地址.我在这里错过了什么吗?

javascript node.js

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

axios get 请求挂起,没有错误,catch 未触发

当我在节点上使用 axios 发出 GET 请求时,它只是挂起,不会抛出 catch 并捕获错误。

我不知道如何调试这个,没有抛出错误。我正在启动 Spotify API,但如果那边出现问题,我肯定会得到一些响应吗?

有一段时间我收到了 ECONNRESET 错误,我的互联网不太稳定。但这个错误不再被抛出。

我尝试过使用 fetch,同样的问题。我又回到了经典的 Promise 语法。从现在起它一直运行良好。

该方法被调用并记录。

"node": "10.0.0",
"axios": "^0.19.0",
Run Code Online (Sandbox Code Playgroud)

    function tryFetchForPlaylists(usersCred) {
        console.log('req method called ', usersCred)
        let playlistData;

        try {
            playlistData = axios.get('https://api.spotify.com/v1/users/' + usersCred.userId + '/playlists',
                {
                    headers: {
                        'Authorization': 'Bearer ' + usersCred.accessToken,
                        'Content-Type': 'application/json'
                    }
                });

        } catch (err) {
            console.log(err)
            if (err.response.status === 401) {
                console.error(err);
                return {statusCode: 401};
            }
        }

        playlistData.then((res) => {
            console.info('response status',res.status)
            if(res.status === 200) {
                return res; …
Run Code Online (Sandbox Code Playgroud)

spotify node.js express axios

6
推荐指数
1
解决办法
9667
查看次数

ContractNotFound:没有部署合约

我参加了 chainlink 训练营,并试图完成最后的“练习 3:将它们放在一起”。

但是,我被困住了:

brownie run scripts/price_exercise_scripts/01_deploy_price_exercise.py --network kovan
Run Code Online (Sandbox Code Playgroud)

ContractNotFound: No contract deployed at 0xF4030086511a5bEEa4966F8cA5B36dbC97BeE88c

打印的contract_type._name是从`MockV3Aggregator 返回的模拟地址,这也没有意义,为什么代码调用这个逻辑。

def get_contract(contract_name):

contract_type = contract_to_mock[contract_name]
if network.show_active() in NON_FORKED_LOCAL_BLOCKCHAIN_ENVIRONMENTS:
    if len(contract_type) <= 0:
        deploy_mocks()
    contract = contract_type[-1]
else:
    try:
        contract_address = config["networks"][network.show_active()][contract_name]

        contract = Contract.from_abi(
            contract_type._name, contract_address, contract_type.abi
        )
    except KeyError:
        print(
            f"{network.show_active()} address not found, perhaps you should add it to 
       the config or deploy mocks?")
        print(
            f"brownie run scripts/deploy_mocks.py --network {network.show_active()}"
        )
return contract
Run Code Online (Sandbox Code Playgroud)

我很难理解这个错误消息,这个命令不应该部署合约吗?即它们应该已经存在于 kovan 网络上?

欢迎任何见解!

python chainlink

4
推荐指数
1
解决办法
2070
查看次数

Connect 方法 DataSource 未发出 MatTable 的所有分页行

我正在尝试使用 DataSource 接口来更新 MatTableData,使用服务器端分页。

<div>

  <mat-table [dataSource]="dataSource" matSort matSortDisableClear>

    <ng-container matColumnDef="type">
      <mat-header-cell *matHeaderCellDef mat-sort-header class="w-200 th-center"> Type</mat-header-cell>
      <mat-cell *matCellDef="let v" class="w-200 th-center"> {{v.type}} </mat-cell>
    </ng-container>

    <ng-container matColumnDef="title">
      <mat-header-cell *matHeaderCellDef mat-sort-header class="w-200 th-center"> Title</mat-header-cell>
      <mat-cell *matCellDef="let v" class="w-200 th-center"> {{v.title}} </mat-cell>
    </ng-container>

    <ng-container matColumnDef="status">
      <mat-header-cell *matHeaderCellDef mat-sort-header class="w-200 th-center"> Status</mat-header-cell>
      <mat-cell *matCellDef="let v" class="w-200 th-center"> {{v.status}} </mat-cell>
    </ng-container>

    <ng-container matColumnDef="url">
      <mat-header-cell *matHeaderCellDef mat-sort-header class="w-200 th-center"> Url</mat-header-cell>
      <mat-cell *matCellDef="let v" class="w-200 th-center"> {{v.url}} </mat-cell>
    </ng-container>

    <ng-container matColumnDef="host">
      <mat-header-cell *matHeaderCellDef mat-sort-header class="w-250 th-center"> …
Run Code Online (Sandbox Code Playgroud)

angular-material2 angular

0
推荐指数
1
解决办法
1978
查看次数