会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 132495个问题
JAVA 全系列/第六阶段:项目管理与SSM框架/SpringMVC 28713楼
Python 全系列/第八阶段:轻量级Web开发利器-Flask框架/Flask视图高级 28714楼
Python 全系列/第十九阶段:数据分析-数据管理/数据分析案例_案例1_足球运动员分析 28715楼
WEB前端全系列/第二十阶段:Vue2企业级项目(旧)/Ego商城高级Vue实战项目 28717楼

老师,我这运行项目时,出现了这个问题,全部重来了三遍,网上的帖子也试了(坐标,依赖,和老师环境都一致),还是出现这个问题,卡了一天了,咋回事啊?


这里是源码

dubbo_parent.zip


Could not transfer metadata com.bjsxt:user_provider:1.0-SNAPSHOT/maven-metadata.xml from/to public 

Transfer failed for http://192.168.0.199:8181/nexus/content/groups/public/com/bjsxt/user_provider/1.0-SNAPSHOT/maven-metadata.xml

image.png

JAVA 全系列/第十一阶段:分布式RPC调用和分布式文件存储/Dubbo 28719楼
JAVA 全系列/第二阶段:JAVA 基础深化和提高/IO 流技术(旧) 28720楼

package com.bjsxt.ObjectLiu;

import java.io.*;

public class TestStudent {
    public static void main(String[] args) {
          //write();//调用写对象的方法
        read();//调用读对象的方法
    }
    public static void write(){
        ObjectOutputStream oos= null;
        try {
            //oos = null;
            oos=new ObjectOutputStream(new FileOutputStream("E:\\student.txt"));
            Student stu=new Student("marry",20,"888888");
            Student.schoolName="JN校区";
            oos.writeObject(stu);
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            //关闭
            if (oos!=null){
                try {
                    oos.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

    }
    public static void read(){
        ObjectInputStream ois= null;
        try {
            ois = null;
            ois=new ObjectInputStream(new FileInputStream("E:\\student.txt"));
            Student stu = (Student) ois.readObject();
            System.out.println(stu);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }finally {
            //关闭流
            if(ois!=null){
                try {
                    ois.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

    }
}
//打印结果:Student{name='marry', age=20, pwd='null'}schoolName=null
//杜老师,为什么我的打印结果含有单引号,而讲课的老师的打印结果是没有单引号的,麻烦您帮忙看一下,谢谢您


JAVA 全系列/第二阶段:JAVA 基础深化和提高/IO 流技术(旧) 28721楼

老师你好!

麻烦你看看这是什么问题?

image.png


uwsgi.log文件:

*** Starting uWSGI 2.0.18 (64bit) on [Sun Oct 18 18:01:18 2020] ***

compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-39) on 18 October 2020 07:20:44

os: Linux-3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020

nodename: localhost.localdomain

machine: x86_64

clock source: unix

pcre jit disabled

detected number of CPU cores: 1

current working directory: /pythoncodes/script

writing pidfile to /pythoncodes/script/uwsgi.pid

detected binary path: /pythoncodes/py3env/bin/uwsgi

*** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 

chdir() to /pythoncodes/netshop/

your processes number limit is 3795

your memory page size is 4096 bytes

detected max file descriptor number: 1024

!!! no /etc/mime.types file found !!!

lock engine: pthread robust mutexes

thunder lock: enabled

uWSGI http bound on 0.0.0.0:8000 fd 3

uwsgi socket 0 bound to UNIX address /pythoncodes/script/uwsgi.sock fd 6

*** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 

Python version: 3.8.2 (default, Oct 18 2020, 12:37:31)  [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

PEP 405 virtualenv detected: /pythoncodes/py3env/

Set PythonHome to /pythoncodes/py3env/

Python main interpreter initialized at 0x1d5aca0

*** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 

python threads support enabled

your server socket listen backlog is limited to 100 connections

your mercy for graceful operations on workers is 60 seconds

mapped 486672 bytes (475 KB) for 5 cores

*** Operational MODE: preforking ***

Traceback (most recent call last):

  File "/pythoncodes/py3env/lib/python3.8/site-packages/MySQLdb/__init__.py", line 18, in <module>

    from . import _mysql

ImportError: libmysqlclient.so.18: cannot open shared object file: No such file or directory


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "./netshop/wsgi.py", line 16, in <module>

    application = get_wsgi_application()

  File "/pythoncodes/py3env/lib/python3.8/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application

    django.setup(set_prefix=False)

  File "/pythoncodes/py3env/lib/python3.8/site-packages/django/__init__.py", line 24, in setup

    apps.populate(settings.INSTALLED_APPS)

  File "/pythoncodes/py3env/lib/python3.8/site-packages/django/apps/registry.py", line 114, in populate

    app_config.import_models()

  File "/pythoncodes/py3env/lib/python3.8/site-packages/django/apps/config.py", line 211, in import_models

    self.models_module = import_module(models_module_name)

  File "/usr/local/python38/lib/python3.8/importlib/__init__.py", line 127, in import_module

    return _bootstrap._gcd_import(name[level:], package, level)

  File "/pythoncodes/py3env/lib/python3.8/site-packages/django/contrib/auth/models.py", line 2, in <module>

    from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager

  File "/pythoncodes/py3env/lib/python3.8/site-packages/django/contrib/auth/base_user.py", line 47, in <module>

    class AbstractBaseUser(models.Model):

  File "/pythoncodes/py3env/lib/python3.8/site-packages/django/db/models/base.py", line 117, in __new__

    new_class.add_to_class('_meta', Options(meta, app_label))

  File "/pythoncodes/py3env/lib/python3.8/site-packages/django/db/models/base.py", line 321, in add_to_class

    value.contribute_to_class(cls, name)

  File "/pythoncodes/py3env/lib/python3.8/site-packages/django/db/models/options.py", line 204, in contribute_to_class

    self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())

  File "/pythoncodes/py3env/lib/python3.8/site-packages/django/db/__init__.py", line 28, in __getattr__

    return getattr(connections[DEFAULT_DB_ALIAS], item)

  File "/pythoncodes/py3env/lib/python3.8/site-packages/django/db/utils.py", line 201, in __getitem__

    backend = load_backend(db['ENGINE'])

  File "/pythoncodes/py3env/lib/python3.8/site-packages/django/db/utils.py", line 110, in load_backend

    return import_module('%s.base' % backend_name)

  File "/usr/local/python38/lib/python3.8/importlib/__init__.py", line 127, in import_module

    return _bootstrap._gcd_import(name[level:], package, level)

  File "/pythoncodes/py3env/lib/python3.8/site-packages/django/db/backends/mysql/base.py", line 15, in <module>

    import MySQLdb as Database

  File "/pythoncodes/py3env/lib/python3.8/site-packages/MySQLdb/__init__.py", line 24, in <module>

    version_info, _mysql.version_info, _mysql.__file__

NameError: name '_mysql' is not defined

unable to load app 0 (mountpoint='') (callable not found or import error)

*** no app loaded. going in full dynamic mode ***

*** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 

*** uWSGI is running in multiple interpreter mode ***

spawned uWSGI master process (pid: 4079)

spawned uWSGI worker 1 (pid: 4081, cores: 1)

spawned uWSGI worker 2 (pid: 4082, cores: 1)

spawned uWSGI worker 3 (pid: 4083, cores: 1)

spawned uWSGI worker 4 (pid: 4084, cores: 1)

spawned uWSGI worker 5 (pid: 4085, cores: 1)

spawned uWSGI http 1 (pid: 4086)

--- no python application found, check your startup logs for errors ---

[pid: 4082|app: -1|req: -1/1] 192.168.126.1 () {38 vars in 737 bytes} [Sun Oct 18 10:10:11 2020] GET /admin => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)

--- no python application found, check your startup logs for errors ---

[pid: 4083|app: -1|req: -1/2] 192.168.126.1 () {40 vars in 700 bytes} [Sun Oct 18 10:10:11 2020] GET /favicon.ico => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)

--- no python application found, check your startup logs for errors ---

[pid: 4084|app: -1|req: -1/3] 192.168.126.1 () {38 vars in 737 bytes} [Sun Oct 18 10:10:11 2020] GET /admin => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)

--- no python application found, check your startup logs for errors ---

[pid: 4081|app: -1|req: -1/4] 192.168.126.1 () {40 vars in 700 bytes} [Sun Oct 18 10:10:11 2020] GET /favicon.ico => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)


Python 全系列/下架-第十二阶段:Python_大型电商项目(5天后下架)/Django项目阶段-电商项目(旧) 28725楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637