小编Cia*_*ran的帖子

ImportError:尝试安装软件包时没有名为pip的模块

用PyCharm重新安装Ubuntu 13.10,在设置python解释器时我选择了'install setuptools',然后'install pip'.现在如果我尝试用pip做任何事情,我得到以下内容:

  ciaran@ciaran-desktop:~/pycharm/bin$ pip
  Traceback (most recent call last):
  File "/usr/local/bin/pip", line 9, in <module>
    load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 357, in load_entry_point
   """Does the package's distribution contain the named metadata?"""
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2394, in load_entry_point

  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2108, in load

  ImportError: No module named pip
Run Code Online (Sandbox Code Playgroud)

我已经尝试过python 2.7.5和3.3.2,两者都会产生相同的结果.

编辑:以上输出来自终端.PyCharm输出以下内容:

Error: Python package management tool 'pip' not found 
Run Code Online (Sandbox Code Playgroud)

python pip package python-2.7 python-3.x

12
推荐指数
2
解决办法
3万
查看次数

添加ImageView时应用程序崩溃

我正在尝试将图像添加到我的应用程序,但它一直崩溃,我不能总结为什么.

我的应用程序中有多个图像,但添加这一个图像似乎有问题.这是我的xml(编辑:完整的xml(为了布局目的,这已经改变了原因)):

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="match_parent" >

<Button
    android:id="@+id/imageTextButton4"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBaseline="@+id/imageTextButton3"
    android:layout_alignBottom="@+id/imageTextButton3"
    android:layout_alignLeft="@+id/imageTextButton2"
    android:layout_alignRight="@+id/imageTextButton2"
    android:drawableTop="@drawable/ic_launcher"
    android:text="Progress" />

<Button
    android:id="@+id/imageTextButton3"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/imageTextButton1"
    android:layout_alignRight="@+id/imageTextButton1"
    android:layout_below="@+id/imageTextButton1"
    android:layout_marginTop="85dp"
    android:drawableTop="@drawable/ic_launcher"
    android:text="Meal Plans" />

<Button
    android:id="@+id/imageTextButton2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_centerVertical="true"
    android:layout_marginRight="22dp"
    android:drawableTop="@drawable/ic_launcher"
    android:text="Your Meals" />

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="42dp"
    android:src="@drawable/logo" />

<Button
    android:id="@+id/imageTextButton1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_centerVertical="true"
    android:layout_marginLeft="16dp"
    android:drawableTop="@drawable/ic_launcher"
    android:text="Meal of the Day" />

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

和我的java代码(为了简洁而浓缩):

package com.example.c3347115app;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View; …
Run Code Online (Sandbox Code Playgroud)

java android imageview

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

运营商|| 未定义参数类型boolean,String

我继续使用以下IF语句获取上述错误消息.任何帮助表示赞赏.

public void sendMessage(View button) {
        String mName = Name.getText().toString();
        String mGuess = Guess.getText().toString();
        if (mGuess != "1" || "2" || "3" || "4" || "5" || "6" || "7" || "8" || "9" || "10") {
            Toast.makeText(MainActivity.this,
                    "The number you entered was invalid. Please try again.", Toast.LENGTH_LONG).show();
        }
Run Code Online (Sandbox Code Playgroud)

java android

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

ORDER BY函数在Oracle中不起作用

我正在使用ORDER BY函数按照下面的顺序按客户ID排序一个简单的查询(它最初是派对时代,但似乎没有用,所以我改变它以查看它是否是语法).

SELECT   customer_id, customer_name, party_age
FROM     customer
ORDER BY customer_id
Run Code Online (Sandbox Code Playgroud)

该报告没有返回任何错误,但当我去查看报告时,它根本没有订购.我也尝试使用数字(ORDER BY x).

有人引导我朝着正确的方向前进吗?

编辑:Customer_id是VARCHAR2(3),有10个样本数据字段,范围从001到010.我尝试过转换为int,如下所示,但结果仍然相同.

sql sorting oracle sql-order-by

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

未找到FROM关键字 - ORA-00923

我有这个简单的SQL查询,我试图为uni项目运行.我在标题中收到错误但是我运行了一个非常类似的查询没有问题.

select booking.customer_id, booking_start_date
   SUM(total_cost) sales
from booking
order by 2 desc 
Run Code Online (Sandbox Code Playgroud)

提前致谢.

sql oracle

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

PHP md5哈希无法正常工作

我有以下PHP代码用于注册到网站.我正在尝试哈希密码以确保安全性,但每当我提交虚拟注册时,密码都不会在phpMyAdmin中进行哈希处理.它们看似正常.这是我的代码:

<?php

//get the values from the form
$Name = $_POST['name'];
$Username = $_POST['username'];
$Password = $_POST['password'];
$RepeatPassword = $_POST['repeatpassword'];

//encrypt the passwords
md5($Password);
md5($RepeatPassword);

//query the database
$query = "INSERT INTO users VALUES ('', '$Name', '$Username', '$Password')";

if (!mysql_query($query)) {

die('Error ' . mysql_error() . ' in query ' . $query);
} 

//check passwords match
if ($Password !== $RepeatPassword) {
echo "Your passwords do not match. <a href='login.php'>Return to login page</a>";

}

//check to see if fields are blank …
Run Code Online (Sandbox Code Playgroud)

php md5

-1
推荐指数
1
解决办法
2463
查看次数

标签 统计

android ×2

java ×2

oracle ×2

sql ×2

imageview ×1

md5 ×1

package ×1

php ×1

pip ×1

python ×1

python-2.7 ×1

python-3.x ×1

sorting ×1

sql-order-by ×1