FTLinuxCourse - Tin tổng hợp mới nhất không thể bỏ lỡ
  • Home
  • Lập Trình Linux
  • Công Nghệ
  • Máy Tính
No Result
View All Result
  • Home
  • Lập Trình Linux
  • Công Nghệ
  • Máy Tính
No Result
View All Result
FTLinuxCourse - Tin tổng hợp mới nhất không thể bỏ lỡ
No Result
View All Result

Python Getting Started With setuptools setup.py setup.cfg and OpenStack pbr

admin by admin
February 11, 2020
in Lập Trình Linux
5
Python Getting Started With setuptools setup.py setup.cfg and OpenStack pbr



Python Getting Started With setuptools setup.py setup.cfg and OpenStack pbr

1)
Install setuptools
#sudo apt-get install python-setuptools

2)
select a python project/module which we need to to install using setuptools

3)
Open python console and try import your project/module and you should get error, since project/module not installed.

4)
* Create a setup.py file in the project/module folder with following lines and run #python setup.py build and install
import setuptools
setuptools.setup()

* Edit setup.py file and add following line and run #python setup.py build and install
import setuptools
setuptools.setup(name=”regservice”, packages=setuptools.find_packages())

Examples:

5)
Run “#python setup.py build”
* Check the folders and files which are created by above command
* Create a requirement.txt file in project/module folder and run “#python setup.py build” again and check the require.txt file in the egg folder.
* Run “#python setup.py install” and open a python console and try to import your project/module
* Try different options of #python setup.py build
* Try different options of #python setup.py install

6)
setup.py commands
————————–
#python setup.py –help-commands

a)
#sudo python setup.py build –help

b)
#sudo python setup.py install –help

Options for ‘install’ command:

–user install in user site-package
‘/home/saju/.local/lib/python2.7/site-
packages’

–record filename in which to record list of
installed files

#sudo python setup.py install –user

#sudo python setup.py install –user –record=a.txt

c)
sudo python setup.py sdist

d)
sudo python setup.py nosetests

e)
sudo python setup.py build_sphinx

f)
sudo python setup.py develop -z

g)
sudo python setup.py test

h)
sudo python setup.py install –user saveopts
sudo python setup.py develop -z saveopts

7)
* Modify the setup.py file in the project/module folder with following lines
import setuptools
setuptools.setup(setup_requires=[‘pbr’], pbr=True)

* What is pbr

* Run “#python setup.py build” and examin requirement.txt and egg/require.txt
* Create a setup.cfg file in the project/module folder with following lines
[metadata]
name= blabla
* Run “#python setup.py build” and examin requirement.txt and egg/require.txt
* Run “#python setup.py install” and open python console and try to import your project/module

8)
* Uninstall a package which installed with command “#python setup.py install”
#sudo pip uninstall regservice

9)
* Modify the setup.py file in the project/module folder with following lines
import setuptools
setuptools.setup()

Then run following command to install the module and try to import the module in python console. You can use “#sudo pip uninstall regservice” to unstall the module
#sudo python setup.py install

10)
modify the setup.py in the project folder with following lines
import setuptools
setuptools.setup(name=”regservice”)

Then run following command to install the module and try to import the module in python console. You can use “#sudo pip uninstall regservice” to unstall the module#sudo python setup.py install

Nguồn:https://ftlinuxcourse.com/

Xem Thêm Bài Viết Khác:https://ftlinuxcourse.com/lap-trinh-linux

Tags: Youtube
Previous Post

Linux embedded Unit 13 System call

Next Post

Hệ Điều Hành Mac OS Là Gì Nó Có Khác Với Windows Hay Không ?

Next Post
Hệ Điều Hành Mac OS Là Gì Nó Có Khác Với Windows Hay Không ?

Hệ Điều Hành Mac OS Là Gì Nó Có Khác Với Windows Hay Không ?

Comments 5

  1. Thepac says:
    2 years ago

    tks for such a good tut

    Reply
  2. Anes P.A says:
    2 years ago

    Dear Friends and Saju,I have an issue in Make install … please read the thread and reply me
    How to copy an image file on Makeinstall of Gtk2 app ?
    http://www.gtkforums.com/viewtopic.php?f=3&t=179183

    Reply
  3. Muhammad Adnan says:
    2 years ago

    i have problem with fb.py (((((((((( no module named mechanize )))))))))))) how solve it i dont understnad your method is too long so bro explane me on some simple steps please ???????????????

    Reply
  4. Rafik Harzi says:
    2 years ago

    @Leo Adams I know that you probably had your response by now but may be someone else will read this and find it useful :
    to paste into console or vim it's: { control + shift + v }

    Reply
  5. Lerner Zhang says:
    2 years ago

    Hello, Saju,

    Thanks very much for the awesome tutorial. 

    Could you please tell me how I can paste the content from clipboard to prompt and vim as you did at 0:43 and 4:12?

    Peace,
    Leo

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Xem Thêm

Những điều bạn có thể chưa biết về Thánh sim Hi Vietnamobile

Những điều bạn có thể chưa biết về Thánh sim Hi Vietnamobile

January 17, 2021
Xiaomi Mi 10 Pro thiết kế thời thương, màn hình cong ấn tượng

Xiaomi Mi 10 Pro thiết kế thời thương, màn hình cong ấn tượng

June 1, 2021
Địa chỉ in bao bì nhựa tại Đà Nẵng chiết khấu cao

Địa chỉ in bao bì nhựa tại Đà Nẵng chiết khấu cao

January 26, 2021
Địa chỉ bán đèn tuýp LED Philips uy tín và chất lượng trên thị trường?

Bán đèn tuýp led Philips – Skyled

July 27, 2020
Lựa chọn chủ đề in áo thun phù hợp

Lựa chọn dịch vụ in áo thun cotton cần lưu ý gì?

August 2, 2020
Cần xác định được điểm đặt pallet cao nhất để mua xe

Bí quyết chọn mua xe nâng điện đẩy tay

August 3, 2020

Về Chúng Tôi

Báo ftlinuxcourse.com 24h – Đón xem những tin tức mới nhất về tình hình chính trị, xã hội, an ninh trật tự, văn hóa – giải trí, thể thao, thông tin trong ngày.

  • Liên Hệ
  • Chính Sách Bảo Mật

© 2022 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Lập Trình Linux
  • Công Nghệ
  • Máy Tính

© 2022 JNews - Premium WordPress news & magazine theme by Jegtheme.